diff --git a/config/common.nix b/config/common.nix index cf617e7..a877eb7 100644 --- a/config/common.nix +++ b/config/common.nix @@ -25,7 +25,6 @@ firefox git git-crypt - vim ]; fonts.fonts = with pkgs; [ diff --git a/home/home.nix b/home/home.nix index e895b16..19e3d08 100644 --- a/home/home.nix +++ b/home/home.nix @@ -25,6 +25,19 @@ size = 12; }; }; + programs.neovim = { + enable = true; + coc.enable = true; + vimAlias = true; + withNodeJs = true; + plugins = with pkgs.vimPlugins; [ + coc-nvim + coc-clangd + vim-airline + onedark-vim + ]; + extraConfig = builtins.readFile ./vimrc; + }; programs.zsh = { enable = true; enableSyntaxHighlighting = true; diff --git a/home/vimrc b/home/vimrc new file mode 100644 index 0000000..b1cbc40 --- /dev/null +++ b/home/vimrc @@ -0,0 +1,76 @@ +set nocompatible +set showcmd +set rnu + +syntax on +filetype on +filetype plugin on +filetype indent on + +colorscheme onedark +hi Comment guifg=#b7ffbd ctermfg=102 +hi Normal guifg=#eeeeee guibg=#00000ee + +let g:airline#extensions#tabline#enabled = 1 +let g:airline_powerline_fonts = 1 + +" --BACKUP +set backup +set backupdir=~/.vim/backup/ +set writebackup +set backupcopy=yes +au BufWritePre * let &bex = '@' . strftime("%F.%H:%M") + +" --Display +set mouse=ar +set title +set number "Line numbers +set ruler +set wrap +set scrolloff=3 +set lazyredraw +set termguicolors +set foldmethod=indent +set foldlevelstart=8 "Don't fold automatically unless really nested + +" --Search +set ignorecase +set smartcase +set incsearch +set hlsearch + +" --Tab +set tabstop=4 +set shiftwidth=4 +set softtabstop=0 + +" --Beep +set visualbell +set noerrorbells + +set backspace=indent,eol,start + +set hidden + +" --Svelte files are essentially HTML +autocmd BufRead,BufNewFile *.svelte set filetype=html + +" --My cute shortcuts +noremap // :nohls +inoremap jj + +" (q)uit, (w)ith path edit, (e)dit, (r)eload +noremap ,q :wqa +noremap ,w :tabedit +noremap ,e :tabnew:Files +noremap ,r :so ~/.vimrc +" (h)elp +noremap ,h :help + +noremap :bn +noremap :bp + +autocmd FileType cpp noremap ,c :!g++ +autocmd FileType cpp map ,cf ,c"%" +autocmd FileType cpp map ,r ,c-o a ;./a;rm a +autocmd FileType cpp map ,rf ,r"%"