era-configuration-nix/vim.nix

111 lines
2.9 KiB
Nix

with import <nixpkgs> {};
vim_configurable.customize {
# Specifies the vim binary name.
# E.g. set this to "my-vim" and you need to type "my-vim" to open this vim
# This allows to have multiple vim packages installed (e.g. with a different set of plugins)
name = "vim";
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins;
vimrcConfig.vam.pluginDictionaries = [
{ names = [
# Here you can place all your vim plugins
# They are installed managed by `vam` (a vim plugin manager)
"vim-nix"
"Solarized"
"fugitive"
"surround"
"elm-vim"
"vimtex"
#"vim/.vim/bundle/VOoM" is missing
#"vim/.vim/bundle/vim-better-whitespace is missing
#"vim/.vim/bundle/vim-systemd-syntax is missing
#"vim/.vim/bundle/vim-obsession is missing
#"vim/.vim/bundle/vim-opencl is missing
]; }
];
vimrcConfig.customRC = ''
" Must have for vim
set nocompatible
" Display nbsp
set listchars=tab:\|\ ,nbsp:·
set list
" Remap ESC on ,,
map ,, <ESC>
imap ,, <ESC>
scriptencoding utf-8
" Must be *after* pathogen
filetype plugin indent on
" Leader
let mapleader=","
nnoremap <leader>a :echo("\<leader\> works! It is set to <leader>")<CR>
" let maplocalleader = "-"
" Highlighting
syntax enable
if has('gui_running')
" When gui is running, it pretty much sets its own colors
set background=light
set guifont=Inconsolata\ 16
else
" If we're in a terminal, then we stay default, terminal will choose
" which colors it likes.
set background=dark
endif
let g:solarized_termcolors=16
colorscheme solarized
" Set line numbering
set number
" Don't wrap lines, it's ugly
set nowrap
" Deal with tabs
set softtabstop=2
set tabstop=2 " 1 tab = 2 spaces
set shiftwidth=2 " Indent with 2 spaces
set expandtab " Insert spaces instead of tabs
" Set par as default wrapper
set formatprg=par\ -w80
" Set mouse on
set mouse=a
" Don't set timeout - this breaks the leader use
set notimeout
set ttimeout
let &colorcolumn=join(range(81,999),",")
" vimtex options
let g:vimtex_fold_enabled=1
let g:vimtex_fold_manual=1
" nice pluginless stuff
set path+=**
set wildmenu
" Tag generation
command! MakeTags !ctags -R .
" Less noise in netrw
let g:netrw_banner=0
let g:netrw_browse_split=4
let g:netrw_altv=1
let g:netrw_liststyle=3
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
" Normal backspace
set backspace=indent,eol,start
'';
}