era-configuration-nix/vim.nix

106 lines
2.7 KiB
Nix
Raw Normal View History

2017-02-28 22:55:14 +01:00
# Largely adapted from: https://www.mpscholten.de/nixos/2016/04/11/setting-up-vim-on-nixos.html
2017-02-28 22:09:06 +01:00
with import <nixpkgs> {};
vim_configurable.customize {
name = "vim";
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins;
vimrcConfig.vam.pluginDictionaries = [
{ names = [
"vim-nix"
"Solarized"
"fugitive"
"surround"
"elm-vim"
"vimtex"
2017-03-11 10:47:47 +01:00
#https://github.com/vim-voom/VOoM
#https://github.com/ntpeters/vim-better-whitespace
#https://github.com/Matt-Deacalion/vim-systemd-syntax
#https://github.com/tpope/vim-obsession
#https://github.com/petRUShka/vim-opencl
2017-02-28 22:09:06 +01:00
]; }
];
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
2017-02-28 23:13:53 +01:00
set formatprg=${par.outPath}/bin/par\ -w80
2017-02-28 22:09:06 +01:00
" 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
'';
}