infra/configuration/common/pkg/neovim.nix

223 lines
6.2 KiB
Nix
Raw Normal View History

2015-10-23 01:26:53 +02:00
{ config, pkgs, ... }:
let
gitpkgs = import <gitpkgs> {};
2015-10-23 01:26:53 +02:00
commonPkgs = with pkgs; [
xsel
2015-10-23 01:26:53 +02:00
];
2016-06-28 11:39:21 -07:00
goPkgs = with gitpkgs; [
go_1_6
gotools.bin
# godef.bin
godep
# go-errcheck.bin
2015-10-23 01:26:53 +02:00
];
pythonPkgs = with pkgs.python2Packages; [
blockdiag
seqdiag
actdiag
nwdiag
#packetdiag
#rackdiag
];
in {
environment.systemPackages = commonPkgs ++ goPkgs ++ pythonPkgs ++ [
(pkgs.neovim.override {
2015-10-23 01:26:53 +02:00
vimAlias = true;
configure = {
# add custom .vimrc lines like this:
customRC = ''
set nocompatible
" leader
let mapleader = ','
set hidden
syntax on
set hlsearch
set number
" mappings to stop insert mode
imap jjj <ESC>
imap kkk <ESC>
imap lll <ESC>
imap hhh <ESC>
set scroll=11
noremap <C-n> :tabn<CR>
noremap <C-p> :tabp<CR>
let g:ctrlp_map = '<tab>'
set wildignore+=*/site/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|)$$',
\ 'file': '\v\.(exe|so|dll)$$',
\ }
"let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
"let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
" allways show status line
set ls=2
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
"set textwidth=80
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
2016-06-28 11:39:57 -07:00
" syntastic {
2015-10-23 01:26:53 +02:00
au FileType qf setlocal wrap linebreak
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
if has("gui_running")
set mouse=a
else
set mouse=
endif
set wildignore+=*/site/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|)$$',
\ 'file': '\v\.(exe|so|dll)$$',
\ }
2016-06-28 11:39:57 -07:00
" }
2015-10-23 01:26:53 +02:00
2016-06-28 11:40:12 -07:00
" spelling {{{
au BufRead,BufNewFile *.md,*.markdown setlocal spell spelllang=en_us,de_de
" }}}
2015-10-23 01:26:53 +02:00
2016-06-28 11:39:57 -07:00
" sync default register to clipboard {
2015-10-23 01:26:53 +02:00
if has('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
2016-06-28 11:39:57 -07:00
" }
2015-10-23 01:26:53 +02:00
2016-06-28 11:39:57 -07:00
" colored brackets {
2015-10-23 01:26:53 +02:00
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toggle = 0
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
2016-06-28 11:39:57 -07:00
" }
2015-10-23 01:26:53 +02:00
set t_ut=
colorscheme PaperColor
" Python {{{
augroup ft_python
au!
au FileType python setlocal omnifunc=pythoncomplete#Complete
au FileType python setlocal define=^\s*\\(def\\\\|class\\)
augroup END
" }}}
" YAML {{{
augroup ft_yaml
au!
setlocal autoindent sw=2 et tabstop=2 shiftwidth=2 softtabstop=2
augroup END
" }}}
2016-06-28 11:39:21 -07:00
" vim-go {
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
2016-07-08 15:03:42 -07:00
let g:go_fmt_command = 'gofmt'
let g:go_fmt_options= '-s'
let g:go_def_mode = 'godef'
let g:go_def_reuse_buffer = 0
2016-06-28 11:39:21 -07:00
au FileType go nmap <Leader>gds <Plug>(go-def-split)
au FileType go nmap <Leader>gdv <Plug>(go-def-vertical)
au FileType go nmap <Leader>gdt <Plug>(go-def-tab)
" }
2015-10-23 01:26:53 +02:00
'';
vam.knownPlugins = gitpkgs.vimPlugins; # optional
2015-10-23 01:26:53 +02:00
vam.pluginDictionaries = [ # full ducomentation at github.com/MarcWeber/vim-addon-manager
"vim-addon-vim2nix"
"youcompleteme"
"vim-airline"
"vim-addon-nix"
"ctrlp"
"vim-go"
2016-06-28 11:39:21 -07:00
# "syntastic"
2015-10-23 01:26:53 +02:00
"tagbar"
"vim-css-color"
"rainbow_parentheses"
"vim-colorschemes"
"vim-colorstepper"
"vim-signify"
2016-06-28 11:39:21 -07:00
# "vim-pandoc"
# "vim-pandoc-syntax"
# "vim-pandoc-after"
# "vimpreviewpandoc"
2015-10-23 01:26:53 +02:00
];
};
extraPythonPackages = with gitpkgs.python2Packages; [
2015-10-23 01:26:53 +02:00
pandocfilters
htmltreediff
html5lib
dbus
2015-10-23 01:26:53 +02:00
] ++ pythonPkgs;
withPython3 = false;
})
];
2015-10-23 01:26:53 +02:00
}