-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
126 lines (95 loc) · 3.05 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
" vimrc 0.4
" Rob Jefferson <[email protected]>
"
" Designed to help me get work done
" Because I use fish, and it's not POSIX-compatible,
" I need to run bash instead or else vundle throws
" myriad errors
if $SHELL=~'bin/fish'
set shell=/bin/bash
endif
" Make vim work like vim, and not vi
set nocompatible
" I like syntax highlighting
syntax enable
" Turning off filetype detection for now
filetype off
source ~/.vim/plugin_list.vim
" Turning it back on after the plugins are loaded
filetype plugin indent on
" Backspace should go to the previous line, etc.
set backspace=indent,eol,start
" Mucking around with colors
set t_Co=256
set background=dark
" I kind of like mouse compatibility with vim. YMMV.
set mouse=a
" Turning things on
let g:rainbow_active=1
let g:airline_powerline_fonts=1
set laststatus=2
let g:airline#extensions#tabline#enabled=1
let g:htmljinja_disable_detection=0
" character encodings
set encoding=utf-8
set fileencoding=utf-8
" increase the history from 20 (default)
set history=1000
" reset the leader to a more easily-accessible character (thanks to
" amix for the suggestion of using the comma)
let mapleader=","
let g:mapleader=","
" add in a local leader
let maplocalleader="\\"
let g:maplocalleader="\\"
" Highlight the cursor line -- makes it harder to get lost on a crowded scree
" set cursorline
" spaces instead of tabs (4 spaces to the tab)
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
" quicksave
nmap <leader>w :w!<cr>
" set NERDTree to ,p and toggling in tabs to ,n
nmap <leader>p :NERDTree<cr>
nmap <leader>n :NERDTreeTabsToggle<CR>
" I like my searches case insensitive, thanks
set ignorecase
" split to the right and to the bottom, rather than to the usual left-and-top.
set splitbelow
set splitright
" make searching update as I type, and highlight the results
set incsearch
set hlsearch
" navigate between the splits easier
" helper functions for wrapping between split panes
" (cf. http://bit.ly/1wjRwBl)
function! s:GotoNextWindow(direction, count)
let l:prevWinNr = winnr()
execute a:count . 'wincmd' a:direction
return winnr() != l:prevWinNr
endfunction
function! s:JumpWithWrap(direction, opposite)
if ! s:GotoNextWindow(a:direction, v:count1)
call s:GotoNextWindow(a:opposite, 999)
endif
endfunction
nnoremap <C-H> :<C-u>call <SID>JumpWithWrap('h', 'l')<CR>
nnoremap <C-J> :<C-u>call <SID>JumpWithWrap('j', 'k')<CR>
nnoremap <C-K> :<C-u>call <SID>JumpWithWrap('k', 'j')<CR>
nnoremap <C-L> :<C-u>call <SID>JumpWithWrap('l', 'h')<CR>
" fencepost (```) syntax highlight for github-flavored markdown
let g:markdown_fenced_languages=['css', 'javascript', 'json=javascript', 'perl', 'xml']
let g:used_javascript_libs='underscore,backbone,jquery'
" folding active by default is annoying
let g:pymode_folding=0
set foldlevelstart=99
" Sometimes I work in Fortran; I want consistent highlighitng when I'm using
" freeform F90/F95 source
let fortran_free_source=1
" I want to manipulate tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove