semi working asyncomplete
This commit is contained in:
@@ -9,12 +9,17 @@
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.vim = inputs.wrappers.wrappers.vim.wrap {
|
||||
inherit pkgs;
|
||||
runtimePkgs = with pkgs; [
|
||||
nixd
|
||||
lua-language-server
|
||||
];
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# vim-lsp
|
||||
# vim-lsp-settings
|
||||
# asyncomplete-vim
|
||||
# asyncomplete-lsp-vim
|
||||
ale
|
||||
vim-lsp
|
||||
asyncomplete-vim
|
||||
asyncomplete-lsp-vim
|
||||
asyncomplete-file-vim
|
||||
vim-vsnip
|
||||
vim-vsnip-integ
|
||||
];
|
||||
vimrc = builtins.readFile ./vimrc;
|
||||
};
|
||||
|
||||
@@ -13,50 +13,56 @@ set softtabstop=2
|
||||
set number
|
||||
set relativenumber
|
||||
set cursorline
|
||||
" Make cursorlinenum a different color
|
||||
|
||||
" Make cursorlinenum a different color
|
||||
augroup colorAutoCmds
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight CursorLineNr cterm=bold guifg=#cba6f7
|
||||
augroup END
|
||||
|
||||
" Searching stuff
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set hlsearch
|
||||
set incsearch
|
||||
|
||||
" asyncomplete navigation
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
|
||||
|
||||
let g:vsnip_integ_debug = 1
|
||||
|
||||
let g:asyncomplete_auto_popup = 1
|
||||
|
||||
" Snippet expansion
|
||||
imap <expr> <C-j> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<C-j>'
|
||||
smap <expr> <C-j> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<C-j>'
|
||||
|
||||
" Snippet placeholder navigation
|
||||
imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
||||
smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
||||
|
||||
" Set different cursor shapes depending on mode
|
||||
let &t_SI = "\e[6 q"
|
||||
let &t_EI = "\e[2 q"
|
||||
augroup cursorCmds
|
||||
au!
|
||||
autocmd VimEnter * silent !echo -ne "\e[2 q"
|
||||
au!
|
||||
autocmd VimEnter * silent !echo -ne "\e[2 q"
|
||||
augroup END
|
||||
|
||||
" Completion menu
|
||||
"inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
"inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
|
||||
|
||||
set omnifunc=ale#completion#OmniFunc
|
||||
nnoremap K <cmd>ALEHover<CR>
|
||||
nnoremap <leader>gd <cmd>ALEGoToDefinition<CR>
|
||||
nnoremap <leader>gr <cmd>ALEFindReferences<CR>
|
||||
nnoremap <leader>ca <cmd>ALECodeAc
|
||||
let g:ale_completion_enabled = 1
|
||||
|
||||
autocmd User lsp_setup call lsp#register_server({
|
||||
set omnifunc=lsp#complete
|
||||
if executable("nixd")
|
||||
autocmd User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'nixd',
|
||||
\ 'cmd': ['nixd'],
|
||||
\ 'allowlist': ['nix'],
|
||||
\ })
|
||||
|
||||
let g:ale_linters = {
|
||||
\ 'nix': ['nixd'],
|
||||
\}
|
||||
|
||||
let g:ale_fixers = {
|
||||
\ 'nix': ['alejandra'],
|
||||
\}
|
||||
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
endif
|
||||
if executable("lua-language-server")
|
||||
autocmd User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'lua_ls',
|
||||
\ 'cmd': ['lua-language-server'],
|
||||
\ 'allowlist': ['lua'],
|
||||
\ })
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user