2020-06-26 18:37:31 +00:00
|
|
|
call plug#begin(stdpath('data') . '/plugged')
|
2020-05-06 21:46:35 +00:00
|
|
|
|
2021-09-11 06:34:52 +00:00
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
exe 'source' (stdpath('config') . '/airline.vim')
|
2020-05-07 17:43:25 +00:00
|
|
|
|
2021-10-13 23:45:52 +00:00
|
|
|
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
|
|
|
" exe 'source' (stdpath('config') . '/coc.vim')
|
2020-04-09 04:18:20 +00:00
|
|
|
|
2020-05-07 04:20:54 +00:00
|
|
|
Plug 'preservim/nerdtree'
|
|
|
|
exe 'source' (stdpath('config') . '/nerdtree.vim')
|
2020-04-09 04:18:20 +00:00
|
|
|
|
2021-03-20 07:40:04 +00:00
|
|
|
" Plug 'ctrlpvim/ctrlp.vim'
|
2020-06-15 08:18:21 +00:00
|
|
|
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
|
|
|
|
|
2021-10-13 23:45:52 +00:00
|
|
|
Plug 'neovim/nvim-lspconfig'
|
|
|
|
Plug 'hrsh7th/nvim-compe'
|
|
|
|
|
2021-09-11 06:35:16 +00:00
|
|
|
Plug 'FStarLang/VimFStar', {'for': 'fstar'}
|
2021-08-28 06:35:36 +00:00
|
|
|
Plug 'LnL7/vim-nix'
|
2021-10-13 23:45:52 +00:00
|
|
|
" Plug 'ashinkarov/nvim-agda'
|
|
|
|
Plug 'derekelkins/agda-vim'
|
2021-09-11 06:34:52 +00:00
|
|
|
Plug 'evanleck/vim-svelte', {'branch': 'main'}
|
2021-09-11 06:35:16 +00:00
|
|
|
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
|
|
|
|
Plug 'sheerun/vim-polyglot'
|
|
|
|
Plug 'tomasiser/vim-code-dark'
|
2021-09-11 06:34:52 +00:00
|
|
|
Plug 'editorconfig/editorconfig-vim'
|
2021-09-12 21:04:58 +00:00
|
|
|
Plug 'ctrlpvim/ctrlp.vim'
|
2021-10-13 23:45:52 +00:00
|
|
|
Plug 'wakatime/vim-wakatime'
|
|
|
|
Plug 'andweeb/presence.nvim'
|
2021-09-11 06:35:16 +00:00
|
|
|
|
|
|
|
call plug#end()
|
2020-06-29 05:26:49 +00:00
|
|
|
|
2020-06-26 18:24:22 +00:00
|
|
|
let g:go_fmt_command = 'goimports'
|
|
|
|
|
2020-05-07 04:20:54 +00:00
|
|
|
let g:vim_markdown_new_list_item_indent = 2
|
2020-06-15 08:18:21 +00:00
|
|
|
let g:vim_markdown_folding_disabled = 1
|
|
|
|
let g:vim_markdown_toml_frontmatter = 1
|
2020-04-09 04:18:20 +00:00
|
|
|
|
|
|
|
" General config
|
|
|
|
|
2021-03-20 07:41:10 +00:00
|
|
|
colorscheme codedark
|
2020-04-09 04:18:20 +00:00
|
|
|
|
|
|
|
set splitright
|
2021-10-13 23:45:52 +00:00
|
|
|
set number relativenumber
|
2020-04-09 04:18:20 +00:00
|
|
|
set cursorline
|
|
|
|
set hidden
|
2020-05-06 22:01:14 +00:00
|
|
|
set modeline
|
|
|
|
set modelines=5
|
2020-05-09 06:42:34 +00:00
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set expandtab
|
2020-06-15 08:18:21 +00:00
|
|
|
set formatoptions+=t
|
2020-07-13 20:45:29 +00:00
|
|
|
set colorcolumn=80
|
2021-10-13 23:45:52 +00:00
|
|
|
set textwidth=80
|
2020-04-09 04:18:20 +00:00
|
|
|
|
|
|
|
syntax on
|
|
|
|
filetype on
|
|
|
|
filetype plugin indent on
|
|
|
|
|
2021-10-13 23:45:52 +00:00
|
|
|
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
|
|
|
|
|
2020-05-07 17:43:25 +00:00
|
|
|
" Binds
|
|
|
|
|
2020-04-09 04:18:20 +00:00
|
|
|
let mapleader = ";"
|
2021-09-11 06:34:52 +00:00
|
|
|
let maplocalleader = ";"
|
2020-05-07 17:43:25 +00:00
|
|
|
|
2020-04-09 04:18:20 +00:00
|
|
|
nnoremap T :vsplit<BAR>vertical resize 54<BAR>terminal<CR>i
|
|
|
|
|
2020-05-07 17:43:25 +00:00
|
|
|
imap kj <Esc>
|
2020-04-09 04:18:20 +00:00
|
|
|
|
|
|
|
nmap <F8> :TagbarToggle<CR>
|
|
|
|
|
|
|
|
" Plugin-related configs
|
|
|
|
|
2021-02-11 20:04:40 +00:00
|
|
|
let g:go_fmt_command = "goimports"
|
2021-10-13 23:45:52 +00:00
|
|
|
|
|
|
|
" LSP
|
|
|
|
|
|
|
|
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
|
|
|
nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>
|
|
|
|
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
|
|
|
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
|
|
|
|
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
|
|
|
nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
|
|
|
|
nnoremap <silent> <space>k <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
|
|
|
|
nnoremap <silent> <space>j <cmd>lua vim.lsp.diagnostic.goto_next()<CR>
|
|
|
|
|
|
|
|
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 "<C-n>"
|
|
|
|
elseif vim.fn.call("vsnip#available", {1}) == 1 then
|
|
|
|
return t "<Plug>(vsnip-expand-or-jump)"
|
|
|
|
elseif check_back_space() then
|
|
|
|
return t "<Tab>"
|
|
|
|
else
|
|
|
|
return vim.fn['compe#complete']()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
_G.s_tab_complete = function()
|
|
|
|
if vim.fn.pumvisible() == 1 then
|
|
|
|
return t "<C-p>"
|
|
|
|
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
|
|
|
return t "<Plug>(vsnip-jump-prev)"
|
|
|
|
else
|
|
|
|
-- If <S-Tab> is not working in your terminal, change it to <C-h>
|
|
|
|
return t "<S-Tab>"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
|
|
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
|
|
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
|
|
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
|
|
|
|
|
|
require'lspconfig'.rust_analyzer.setup{}
|
|
|
|
require'lspconfig'.pyright.setup{}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
" vim: set sw=2 :
|