call plug#begin(stdpath('data') . '/plugged') Plug 'vim-airline/vim-airline' exe 'source' (stdpath('config') . '/airline.vim') " Plug 'neoclide/coc.nvim', {'branch': 'release'} " exe 'source' (stdpath('config') . '/coc.vim') Plug 'preservim/nerdtree' exe 'source' (stdpath('config') . '/nerdtree.vim') " Plug 'ctrlpvim/ctrlp.vim' let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""' Plug 'neovim/nvim-lspconfig' Plug 'hrsh7th/nvim-compe' Plug 'FStarLang/VimFStar', {'for': 'fstar'} Plug 'LnL7/vim-nix' " Plug 'ashinkarov/nvim-agda' Plug 'derekelkins/agda-vim' Plug 'evanleck/vim-svelte', {'branch': 'main'} Plug 'prettier/vim-prettier', { 'do': 'yarn install' } Plug 'sheerun/vim-polyglot' Plug 'tomasiser/vim-code-dark' Plug 'editorconfig/editorconfig-vim' Plug 'ctrlpvim/ctrlp.vim' Plug 'wakatime/vim-wakatime' Plug 'andweeb/presence.nvim' call plug#end() let g:go_fmt_command = 'goimports' let g:vim_markdown_new_list_item_indent = 2 let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_toml_frontmatter = 1 " General config colorscheme codedark set splitright set number relativenumber set cursorline set hidden set modeline set modelines=5 set tabstop=4 set shiftwidth=4 set expandtab set formatoptions+=t set colorcolumn=80 set textwidth=80 syntax on filetype on filetype plugin indent on augroup numbertoggle autocmd! autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif augroup END " Binds let mapleader = ";" let maplocalleader = ";" nnoremap T :vsplitvertical resize 54terminali imap kj nmap :TagbarToggle " Plugin-related configs let g:go_fmt_command = "goimports" " LSP nnoremap gd lua vim.lsp.buf.definition() nnoremap gD lua vim.lsp.buf.declaration() nnoremap gr lua vim.lsp.buf.references() nnoremap gi lua vim.lsp.buf.implementation() nnoremap K lua vim.lsp.buf.hover() nnoremap lua vim.lsp.buf.signature_help() nnoremap k lua vim.lsp.diagnostic.goto_prev() nnoremap j lua vim.lsp.diagnostic.goto_next() lua << EOF vim.o.completeopt = "menuone,noselect" require'compe'.setup { enabled = true; autocomplete = true; debug = false; min_length = 1; preselect = 'enable'; throttle_time = 80; source_timeout = 200; incomplete_delay = 400; max_abbr_width = 100; max_kind_width = 100; max_menu_width = 100; documentation = false; source = { path = true; buffer = true; calc = true; vsnip = true; nvim_lsp = true; nvim_lua = true; spell = true; tags = true; snippets_nvim = true; treesitter = true; }; } local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end local check_back_space = function() local col = vim.fn.col('.') - 1 if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then return true else return false end end -- Use (s-)tab to: --- move to prev/next item in completion menuone --- jump to prev/next snippet's placeholder _G.tab_complete = function() if vim.fn.pumvisible() == 1 then return t "" elseif vim.fn.call("vsnip#available", {1}) == 1 then return t "(vsnip-expand-or-jump)" elseif check_back_space() then return t "" else return vim.fn['compe#complete']() end end _G.s_tab_complete = function() if vim.fn.pumvisible() == 1 then return t "" elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then return t "(vsnip-jump-prev)" else -- If is not working in your terminal, change it to return t "" end end vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) require'lspconfig'.rust_analyzer.setup{} require'lspconfig'.pyright.setup{} EOF " vim: set sw=2 :