devos/users/profiles/neovim/default.nix

66 lines
1.9 KiB
Nix
Raw Normal View History

2021-04-15 12:23:55 +02:00
{ pkgs, config, ... }@inputs:
2021-04-11 18:04:01 +02:00
{
2021-04-11 19:26:38 +02:00
programs.neovim = {
2021-04-11 18:04:01 +02:00
2021-04-11 19:26:38 +02:00
enable = true;
vimdiffAlias = true;
withNodeJs = true;
plugins = with pkgs.vimPlugins; [
{
plugin = coc-nvim;
config = ''
2021-04-11 18:04:01 +02:00
nmap <silent> <F2> <Plug>(coc-rename)
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
'';
2021-04-11 19:26:38 +02:00
}
fzf-vim
{
plugin = iceberg-vim;
config = "colorscheme iceberg";
}
vim-sleuth
2021-08-31 23:20:09 +02:00
vim-nix
2021-08-27 14:43:53 +02:00
pkgs.go-fold-if-err-nil
2021-04-11 19:26:38 +02:00
coc-json
2021-08-24 14:46:19 +02:00
coc-go
2021-04-11 19:26:38 +02:00
coc-html
coc-tsserver
2021-04-28 20:23:15 +02:00
coc-clangd
2021-04-11 19:26:38 +02:00
neoformat
undotree
{
plugin = vim-jsdoc;
config = ''
2021-04-11 18:04:01 +02:00
let g:jsdoc_formatter = "tsdoc"
let g:typescript_indent_disable = 1
'';
2021-04-11 19:26:38 +02:00
}
];
extraConfig = ''
2021-04-11 18:04:01 +02:00
set background=dark
set termguicolors
set ic
set number
set autoindent
set completeopt=menuone,noinsert,noselect
set shortmess+=c
'';
2021-04-11 19:26:38 +02:00
};
2021-04-15 12:23:55 +02:00
home.file."coc-settings" = (import ./coc { inherit pkgs config; });
2021-04-11 18:04:01 +02:00
}