2021-06-25 14:41:46 +01:00
|
|
|
{ config, pkgs, lib, home, ... }:
|
|
|
|
|
|
|
|
{
|
2021-07-01 06:01:08 +01:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
2021-06-25 14:41:46 +01:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
nixfmt
|
|
|
|
vscode
|
|
|
|
];
|
2021-06-27 15:40:34 +01:00
|
|
|
|
2021-06-25 14:41:46 +01:00
|
|
|
programs.neovim = {
|
2021-07-01 05:23:25 +01:00
|
|
|
enable = true;
|
2021-06-25 14:41:46 +01:00
|
|
|
extraConfig = ''
|
2021-06-30 19:52:53 +01:00
|
|
|
" syntax
|
2021-06-25 14:41:46 +01:00
|
|
|
syntax enable
|
2021-06-27 15:40:34 +01:00
|
|
|
|
2021-06-30 19:52:53 +01:00
|
|
|
" color themes
|
2021-06-25 14:41:46 +01:00
|
|
|
set termguicolors
|
2021-06-27 15:40:34 +01:00
|
|
|
colorscheme molokai
|
|
|
|
|
2021-06-30 19:52:53 +01:00
|
|
|
" wildcard mode
|
2021-06-27 17:13:17 +01:00
|
|
|
set wildmode=longest:full,full
|
2021-07-01 01:38:15 +01:00
|
|
|
|
2021-06-30 19:52:53 +01:00
|
|
|
" remapping popup menu (command autocompletion)
|
2021-07-07 10:46:26 +01:00
|
|
|
" cnoremap <expr> <up> pumvisible() ? "<C-p>" : "<up>
|
|
|
|
" cnoremap <expr> <down> pumvisible() ? "<C-n>" : "<down>"
|
|
|
|
" cnoremap <expr> <CR> pumvisible() ? "<C-e>":"<CR>"
|
2021-06-30 19:52:53 +01:00
|
|
|
" set line numbers
|
2021-06-27 17:13:17 +01:00
|
|
|
set number
|
2021-06-27 15:40:34 +01:00
|
|
|
|
2021-06-30 19:52:53 +01:00
|
|
|
" YouCompleteMe
|
2021-06-27 15:40:34 +01:00
|
|
|
let g:ycm_key_list_stop_completion = ['<C-y>', '<CR>']
|
|
|
|
let g:ycm_key_list_select_completion = ['<Up>', '<Down>', '<TAB>']
|
2021-06-30 19:52:53 +01:00
|
|
|
|
|
|
|
" enable indent guides
|
|
|
|
let g:indent_guides_enable_on_vim_startup = 1
|
2021-07-01 05:23:25 +01:00
|
|
|
|
|
|
|
" Exit Vim if NERDTree is the only window left.
|
|
|
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |
|
|
|
|
\ quit | endif
|
|
|
|
|
|
|
|
" Start NERDTree. If a file is specified, move the cursor to its window.
|
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif
|
|
|
|
|
|
|
|
" Start NERDTree when Vim starts with a directory argument.
|
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
|
|
|
|
\ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
|
|
|
|
|
|
|
|
" Exit Vim if NERDTree is the only window left.
|
|
|
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |
|
|
|
|
\ quit | endif
|
|
|
|
|
|
|
|
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
|
|
|
xmap ga <Plug>(EasyAlign)
|
|
|
|
|
|
|
|
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
|
|
|
nmap ga <Plug>(EasyAlign)
|
|
|
|
|
|
|
|
" Highlight row and column
|
|
|
|
set cul
|
|
|
|
set cuc
|
2021-07-07 10:46:26 +01:00
|
|
|
|
|
|
|
" Fix for code not being aligned if between comment blocks
|
|
|
|
set cindent cinkeys-=0#
|
|
|
|
set expandtab shiftwidth=4 tabstop=4 softtabstop=4
|
2021-06-25 14:41:46 +01:00
|
|
|
'';
|
2021-06-27 17:13:17 +01:00
|
|
|
|
2021-07-01 05:23:25 +01:00
|
|
|
viAlias = true;
|
2021-06-25 14:41:46 +01:00
|
|
|
vimAlias = true;
|
2021-07-01 05:23:25 +01:00
|
|
|
plugins = with pkgs.vimPlugins; [
|
|
|
|
vim-nix
|
2021-06-27 15:40:34 +01:00
|
|
|
molokai
|
|
|
|
YouCompleteMe
|
2021-07-01 05:23:25 +01:00
|
|
|
vim-airline
|
2021-06-27 15:16:08 +01:00
|
|
|
vim-airline-themes
|
2021-06-25 14:41:46 +01:00
|
|
|
vim-lsp
|
2021-06-27 15:16:08 +01:00
|
|
|
vim-indent-guides
|
2021-06-27 15:40:34 +01:00
|
|
|
vim-signify
|
2021-07-01 05:23:25 +01:00
|
|
|
nerdtree
|
|
|
|
vim-easy-align
|
2021-07-07 10:46:26 +01:00
|
|
|
vim-fugitive
|
|
|
|
vim-yaml
|
|
|
|
vim-autoformat
|
2021-06-27 15:40:34 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|