From 956df69d7496081db5e7b3621a0bcc7b9d7f7dfc Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 8 Dec 2021 11:52:16 +0100 Subject: move to .config folder --- nvim/init.vim | 192 --------------------------------------------- nvim/lua/git.lua | 29 ------- nvim/lua/lsp_conf.lua | 77 ------------------ nvim/lua/lualine_style.lua | 7 -- 4 files changed, 305 deletions(-) delete mode 100644 nvim/init.vim delete mode 100644 nvim/lua/git.lua delete mode 100644 nvim/lua/lsp_conf.lua delete mode 100644 nvim/lua/lualine_style.lua (limited to 'nvim') diff --git a/nvim/init.vim b/nvim/init.vim deleted file mode 100644 index 77f3cfb..0000000 --- a/nvim/init.vim +++ /dev/null @@ -1,192 +0,0 @@ -autocmd! bufwritepost .vimrc source % - -call plug#begin('~/.vim/plugged') -Plug 'cespare/vim-toml', { 'branch': 'main' } -"Plug 'rust-lang/rust.vim' -Plug 'nvim-lua/plenary.nvim' -Plug 'lewis6991/gitsigns.nvim' -Plug 'nvim-lualine/lualine.nvim' -Plug 'kyazdani42/nvim-web-devicons' -Plug 'luochen1990/rainbow' " color parentheses -Plug 'terryma/vim-multiple-cursors' -Plug 'tpope/vim-fugitive' " git extension for commit logs and etc. -Plug 'editorconfig/editorconfig-vim' -Plug 'ap/vim-css-color' -Plug 'Yggdroot/indentLine' - -Plug 'google/vim-searchindex' - -Plug 'kazhala/close-buffers.nvim' - -if has('nvim') - Plug 'rktjmp/lush.nvim' - Plug 'ellisonleao/gruvbox.nvim' - - Plug 'nvim-telescope/telescope.nvim' - Plug 'neovim/nvim-lspconfig' - Plug 'ms-jpq/coq_nvim', {'branch': 'coq'} - Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'} - Plug 'kyazdani42/nvim-tree.lua' - Plug 'ray-x/lsp_signature.nvim' - Plug 'folke/todo-comments.nvim' - Plug 'saecki/crates.nvim' - Plug 'gelguy/wilder.nvim', { 'do': ':UpdateRemotePlugins' } - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - - Plug 'jose-elias-alvarez/null-ls.nvim' - Plug 'folke/trouble.nvim' - Plug 'folke/lsp-colors.nvim' -endif - - -call plug#end() " required - -syntax on - -set runtimepath+=~/.vim-plugins/LanguageClient-neovim - -set completeopt=menu,menuone,noselect - -set clipboard=unnamed -set mouse=a " click with mouse -set wildmenu -set wildmode=longest,list:full -set wildignore=*~,*.png,*.jpg,*.gif,Thumbs.db,*.min.js,*.swp,*.o,vendor - -set number " number of the current line -set relativenumber " relative number, ..-2 -1 x 1 2, where x is current line -set textwidth=80 -set colorcolumn=80 -set nowrap -set fo-=t - -set tabstop=4 -set shiftwidth=4 -set expandtab " convert tabs in spaces - -set ai " auto indent -set autoread - -set encoding=UTF-8 -set history=1000 -set wildignore+=*.pyc - -set hlsearch " highlight search -set incsearch - -set nowritebackup -set laststatus=2 - -"set cursorline - -set list " spaces as characters -set listchars=eol:⏎,tab:»·,trail:ˑ,nbsp:⎵ - -set foldmethod=indent - -set splitright " split on right side -set lazyredraw -set ttyfast - -set noswapfile - -" rust -" let g:rustfmt_autosave = 1 -" let g:rustfmt_emit_files = 1 -" let g:rustfmt_fail_silently = 0 -" let g:rust_clip_command = 'xclip -selection clipboard' - -set termguicolors -set background=dark - -if has('nvim') - colorscheme gruvbox - highlight CursorLineNr ctermbg=NONE guibg=NONE - - lua require('lualine_style') - lua require('git') - let g:coq_settings = { 'auto_start': v:true } - lua require('lsp_conf') - - lua require('nvim-tree').setup() - lua require('todo-comments').setup() - - call wilder#setup({ - \ 'modes': [':', '/', '?'], - \ }) - call wilder#set_option('renderer', wilder#popupmenu_renderer(wilder#popupmenu_border_theme({ - \ 'highlights': { - \ 'border': 'Normal', - \ }, - \ 'border': 'rounded', - \ 'left': [ - \ ' ', wilder#popupmenu_devicons(), - \ ], - \ }))) - lua require('nvim-treesitter.configs').setup({ highlight = { enable = true, }, }) - - lua require('lsp-colors').setup() - - nnoremap xx TroubleToggle -else - colorscheme pablo -endif - -let g:indentLine_char = '¦' - -let g:netrw_liststyle=1 - -filetype plugin indent on -set nocompatible - -set showcmd " show commands at bottom - - -" nvim-tree -let g:nvim_tree_quit_on_open = 1 -let g:nvim_tree_highlight_opened_files = 1 -nnoremap :NvimTreeToggle - -" ------------ -" MAPS -" ----------- -let mapleader = "," - -nnoremap j gj -nnoremap k gk - -nnoremap tn :tabnew -nnoremap rt :RainbowToggle - -" buffers -nnoremap ]b :bnext -nnoremap [b :bprev -nnoremap b Telescope buffers - -" tabs -nnoremap ]t :tabn -nnoremap [t :tabp - -" only one window -nnoremap o :only - - -nnoremap ff Telescope find_files -nnoremap fg Telescope live_grep -nnoremap fh Telescope help_tags - -nnoremap pa :set paste -nnoremap npa :set nopaste - - -nmap cr :!command cargo r -nmap :EditorConfigReload - -if &diff - "Get from remote - nnoremap dr :diffgetRE - "Get from base - nnoremap db :diffgetBA - "Get from local - nnoremap dl :diffgetLO -endif diff --git a/nvim/lua/git.lua b/nvim/lua/git.lua deleted file mode 100644 index 2f9cbc4..0000000 --- a/nvim/lua/git.lua +++ /dev/null @@ -1,29 +0,0 @@ -require('gitsigns').setup { - signs = { - add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, - change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - }, - keymaps = { - -- Default keymap options - noremap = true, - - ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, - ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, - - ['n hs'] = 'lua require"gitsigns".stage_hunk()', - ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', - ['n hS'] = 'lua require"gitsigns".stage_buffer()', - ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', - ['n hp'] = 'lua require"gitsigns".preview_hunk()', - ['n hB'] = 'lua require"gitsigns".blame_line(true)', - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - watch_gitdir = { - interval = 1000, - follow_files = true - }, -} diff --git a/nvim/lua/lsp_conf.lua b/nvim/lua/lsp_conf.lua deleted file mode 100644 index e339a5c..0000000 --- a/nvim/lua/lsp_conf.lua +++ /dev/null @@ -1,77 +0,0 @@ -local nvim_lsp = require('lspconfig') -local coq = require('coq') -local null_ls = require("null-ls") -local trouble = require("trouble") - --- Redefine sign. -local signs = { Error = 'E', Warning = 'W', Hint = 'H', Information = 'I' } - -for type, icon in pairs(signs) do - local hl = 'LspDiagnosticsSign' .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = '' }) -end - -local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end -local opts = { noremap=true, silent=true } - -null_ls.config({ - debug = false, - save_after_format = false, - sources = { - -- Python - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.isort, - null_ls.builtins.diagnostics.flake8, - -- Rust - null_ls.builtins.formatting.rustfmt, - -- C - null_ls.builtins.formatting.clang_format, - -- JS/TS - null_ls.builtins.formatting.prettier, - } -}) - --- Setup lspconfig. - ---- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -local servers = { 'pyright', 'rust_analyzer', 'tsserver', 'clangd' } -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { - capabilities = coq.lsp_ensure_capabilities(), - on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - - require "lsp_signature".on_attach() - - -- Mappings. - local opts = { noremap=true, silent=true } - - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - end, - flags = { - debounce_text_changes = 150, - } - } -end - -nvim_lsp["null-ls"].setup({ - on_attach = function(client) - if client.resolved_capabilities.document_formatting then - buf_set_keymap('n', '', 'lua vim.lsp.buf.formatting_sync()', opts) - vim.cmd "autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync()" - end - end -}) - -trouble.setup({ - use_lsp_diagnostic_signs = true, - auto_close = true, - auto_open = true -}) - diff --git a/nvim/lua/lualine_style.lua b/nvim/lua/lualine_style.lua deleted file mode 100644 index bb7738b..0000000 --- a/nvim/lua/lualine_style.lua +++ /dev/null @@ -1,7 +0,0 @@ -require'lualine'.setup{ - options = { - theme = 'powerline', - section_separators = { left = '', right = ''}, - component_separators = { left = '|', right = '|'}, - }, -} -- cgit v1.2.3-18-g5258