add some vim config

This commit is contained in:
Charlotte 🦝 Delenk 2022-01-18 21:55:40 +01:00
parent dc77e73448
commit e51abef64e
Signed by: darkkirb
GPG key ID: 015E3768A70AFBC5
2 changed files with 34 additions and 0 deletions

View file

@ -1,6 +1,7 @@
{ pkgs, ... }: {
imports = [
../programs/zsh.nix
../programs/vim.nix
];
programs = {
zsh = {

33
config/programs/vim.nix Normal file
View 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
];
};
}