add some vim config
This commit is contained in:
parent
dc77e73448
commit
e51abef64e
2 changed files with 34 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
../programs/zsh.nix
|
||||
../programs/vim.nix
|
||||
];
|
||||
programs = {
|
||||
zsh = {
|
||||
|
|
33
config/programs/vim.nix
Normal file
33
config/programs/vim.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
coc = {
|
||||
enable = true;
|
||||
};
|
||||
extraConfig = ''
|
||||
set nocompatible
|
||||
set number relativenumber
|
||||
|
||||
" NerdTree config
|
||||
" Automatically open NERDTree and move to the previous window
|
||||
autocmd VimEnter * NERDTree | wincmd p
|
||||
" Close vim when NERDTree is the only window left
|
||||
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
||||
" Ban replacing NERDTree
|
||||
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
|
||||
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
|
||||
|
||||
" NerdTree git plugin
|
||||
" Use nerdfonts
|
||||
let g:NERDTreeGitStatusUseNerdFonts = 1
|
||||
|
||||
" CtrlP config
|
||||
let g:ctrlp_map = '<c-p>'
|
||||
let g:ctrlp_cmd = 'CtrlP'
|
||||
'';
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
nerdtree nerdtree-git-plugin vim-devicons
|
||||
ctrlp-vim
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue