-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot-vimrc
166 lines (142 loc) · 3.83 KB
/
dot-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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
set nocompatible
execute pathogen#infect()
set hidden
set nowrap
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=4
set copyindent
set showmatch
set ignorecase
set smartcase
set hlsearch
set undolevels=1000
set visualbell
set noerrorbells
set nobackup
set noswapfile
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
set pastetoggle=<F2>
set ttimeoutlen=10
set t_Co=256
set guifont=Hack\ 11
if isdirectory("~/.fzf")
set rtp+=~/.fzf
endif
if (has("termguicolors"))
set termguicolors
endif
if has('autocmd')
autocmd FileType python,make,mkd,rmd set shiftwidth=4
autocmd FileType python,make,mkd,rmd set softtabstop=4
autocmd FileType html,xml set listchars-=tab:>.
autocmd FileType html,xml set listchars+=tab:\ \
endif
syntax enable
colorscheme night-owl
nnoremap ; :
nnoremap <esc> :noh<return><esc>
nnoremap j gj
nnoremap k gk
imap jk <Esc>
vmap Q gq
nmap Q gqap
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Get sudo privileges for saving by typing w!!
cmap w!! w !sudo tee % >/dev/null
nnoremap <Space> <Nop>
let mapleader="\<Space>"
let maplocalleader="\<Space>\<Space>"
" Toggle whitespace
nnoremap <leader>wr :set wrap! wrap?<CR>
" Case sensitive, partial match inclusive.
nnoremap <leader>hi :set hlsearch<CR>:let @/='<C-r><C-w>'<CR>
" Case sensitive, no partial match.
nnoremap <leader>ho :set hlsearch<CR>:let @/='\<<C-r><C-w>\>'<CR>
" Case insensitive, partial match inclusive.
nnoremap <leader>hu :set hlsearch<CR>:let @/='<C-r><C-w>\c'<CR>
" Case insensitive, no partial match.
nnoremap <leader>hy :set hlsearch<CR>:let @/='\<<C-r><C-w>\>\c'<CR>
" Toggle whitespace display
nnoremap <leader>li :set list! list?<CR>
" ListToggle
let g:lt_location_list_toggle_map='<leader>ll'
let g:lt_quickfix_list_toggle_map='<leader>lq'
let g:lt_height=5
nnoremap <leader>ln :lnext<CR>
nnoremap <leader>lp :lprevious<CR>
" Statusline
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatuslineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
endfunction
set statusline=
set statusline+=%#PmenuSel#
set statusline+=%{StatuslineGit()}
set statusline+=%#LineNr#
set statusline+=\ %f
set statusline+=%m\
set statusline+=%=
set statusline+=%#CursorColumn#
set statusline+=\ %y
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
set statusline+=\[%{&fileformat}\]
set statusline+=\ %p%%
set statusline+=\ %l:%c
set statusline+=\
" Vimscript
let g:vim_indent_cont = &sw
" Markdown mode
let g:vim_markdown_folding_level=6
let g:vim_markdown_math=1
let g:vim_markdown_frontmatter=1
let g:vim_markdown_conceal=0
let g:tex_conceal=""
let g:vim_markdown_math=1
" Pandoc mode
let g:pandoc#folding#fdc=0
let g:pandoc#syntax#conceal#use=0
let g:pandoc#folding#mode='stacked'
" Table mode
let g:table_mode_corner='|'
" R/RMarkdown mode
augroup filetype
autocmd! BufRead,BufNewFile *.Rmd set filetype=rmd
augroup END
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let r_indent_align_args = 0
let g:syntastic_always_populate_loc_list=1
let g:syntastic_auto_loc_list=2
let g:syntastic_check_on_open=1
let g:syntastic_check_on_wq=0
let g:syntastic_enable_r_lintr_checker=1
let g:syntastic_rmd_checkers=['lintr']
let g:syntastic_r_lintr_exec='/usr/bin/R'
let g:syntastic_r_lintr_linters='with_defaults(
\ line_length_linter(100),
\ assignment_linter,
\ pipe_continuation_linter,
\ closed_curly_linter,
\ commas_linter,
\ infix_spaces_linter,
\ no_tab_linter,
\ object_name_linter("snake_case"),
\ open_curly_linter,
\ semicolon_terminator_linter,
\ spaces_inside_linter,
\ spaces_left_parentheses_linter,
\ trailing_whitespace_linter,
\ T_and_F_symbol_linter,
\ undesirable_function_linter,
\ undesirable_operator_linter
\ )'