-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
144 lines (121 loc) · 3.67 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
" for pathogen package manager
execute pathogen#infect()
" used for autoindenting. filetype pl... sets indent for language specific
set autoindent
filetype plugin indent on
" colors
syntax enable
set t_Co=256
set background=dark
"colorscheme solarized
"colorscheme Tomorrow-Night-Eighties
"colorscheme base16-ocean
if filereadable(expand("~/.vimrc_background"))
let base16colorspace=256
source ~/.vimrc_background
endif
" set leader to something easy to hit
let mapleader=';'
" map s to save and turn off swap
nnoremap s :w<cr>
set noswapfile
" map jk to escape in insert mode
imap jk <esc>
" use space for commands
nnoremap <space> :
" basic setup
set number " show line numbers
set ruler " show % scrolled, line, and column in status bar
set nowrap " disable line wrapping
set hidden " hide buffers instead of closing them
set cursorline " highlight current line
set backspace=2 " make backspace work like most other apps
set incsearch " move cursor to next string while typing in search
" show unwanted whitespace
set list
set listchars=trail:~,tab:>~
nmap <leader>w :set list!<CR> " toggle whitespace easily
let &colorcolumn="121" " highlight 81 char col
" tab
set tabstop=2 " sets the width of the tab to 2
set shiftwidth=2
set softtabstop=2
set smarttab " use spaces instead of tabs at beginning of line
set expandtab " use spaces instead of tabs
" toggle expandtab
nmap <leader>t :set expandtab!<CR>
" folding
set foldmethod=indent
nmap <leader><space> za
" buffer mapping
nmap <leader>h :bp<CR>
nmap <leader>l :bn<CR>
" use plugin to not exit program when close buffer
nmap <leader>d <Plug>Kwbd
" close quickfix
nmap <leader>q :ccl<CR>
" open quickfix by default after grep (useful for :Glog)
autocmd QuickFixCmdPost *grep* cwindow
" split movement
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" save and repeat last command (useful for running scripts)
nmap <leader>r :w<CR>@:
" airline settings
set laststatus=2
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#fnamemod=1
let g:airline#extensions#tabline#buffer_nr_show=1
let g:airline_powerline_fonts = 1
let g:airline_theme='base16'
set ttimeoutlen=50
" syntastic
let g:syntastic_mode_map = { 'mode': 'passive',
\ 'active_filetypes': ['javascript', 'css'],
\ 'passive_filetypes': ['html', 'python'] }
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_css_checkers = ['csslint']
let g:syntastic_python_checkers = ['pylint']
" ctrlp
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_max_files=0
let g:ctrlp_working_path_mode = '' " use pwd
let g:ctrlp_follow_symlinks=2
nnoremap <leader>b :CtrlPBuffer<cr>
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
set wildignore+=*/node_modules/**
" use ag instead of ack
let g:ctrlp_user_command = 'ag %s -i -l --nocolor --nogroup --hidden --follow
\ --ignore .git
\ --ignore .svn
\ --ignore .hg
\ --ignore .DS_Store
\ --ignore "**/*.pyc"
\ -g ""'
let g:ctrlp_use_caching = 0 " ag is fast enough
" use pymatcher
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
" ctags with ctrlp
nnoremap <leader>. :CtrlPTag<cr>
" nerdcommentor
let g:NERDSpaceDelims = 1
" ack
cabbrev ag Ack!
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
" UltiSnips
let g:UltiSnipsSnippetDirectories=['UltiSnips', 'vim-snippets/UltiSnips']
" Pencil
let g:pencil#wrapModeDefault = 'soft'
augroup pencil
autocmd!
autocmd FileType markdown,mkd call pencil#init()
autocmd FileType text call pencil#init()
autocmd FileType vimwiki call pencil#init()
augroup END
" vimwiki
let g:vimwiki_list = [{'path': '~/Dropbox/notes'}]