-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.vimrc
195 lines (160 loc) · 4.95 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
" ░█░█░▀█▀░█▄█
" ░▀▄▀░░█░░█░█
" ░░▀░░▀▀▀░▀░▀
" ------Global configs:
filetype plugin on
let g:ShiftTabDefaultCompletionType = "<C-X><C-O>"
runtime! debian.vim
set autoread wildmode=longest,list,full
set background=dark
set complete+=k
set cursorline cursorcolumn
set dictionary+=/usr/share/dict/words
set hlsearch
set ignorecase
set incsearch
set joinspaces
set laststatus=2
set list
set listchars=tab:▸\ ,eol:¬
set mouse=a
set nocompatible
set noshowmode
set nostartofline
set number relativenumber
set omnifunc=syntaxcomplete#Complete
set showcmd
set showmatch
set spell spelllang=es,en_us
set spellsuggest=10
set splitbelow
set splitright
set wildmenu
set wrapmargin=0
set wrap
"Necessary order, ignore the alphabetical order for the next three lines:
set linebreak
set textwidth=0
set display=lastline
"End of alphabetical exception.
syntax on
" -----Global autocommands:
"Jump to the last position when reopening a file:
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" ------Keybindings:
"Set space as the leader key:
let mapleader = "\<space>"
"Return to normal mode:
imap fd <Esc>
vmap fd <Esc>
"Toggle Goyo on/off:
map <leader>g :Goyo \| set linebreak<CR>
"Vim-like movement between splits:
nnoremap <C-h> <C-W>h
nnoremap <C-j> <C-W>j
nnoremap <C-k> <C-W>k
nnoremap <C-l> <C-W>l
"Resize splits with arrow keys:
nnoremap <Left> :vertical resize +2<CR>
nnoremap <Right> :vertical resize -2<CR>
nnoremap <Down> :resize -2<CR>
nnoremap <Up> :resize +2<CR>
"Move between buffers:
nmap <Leader>[ :bprev<CR>
nmap <Leader>] :bnext<CR>
"Primary selection and clipboard copy and paste:
vnoremap <C-c> "+y
map <C-p> "+P
vnoremap <C-c> "*y :let @+=@*<CR>
"Move lines when in visual mode up or down:
xnoremap K :move '<-2<CR>gv-gv
xnoremap J :move '>+1<CR>gv-gv
"Insert citation characters for markdown notes, move three characters
"to the left and then switch to insert mode:
nnoremap <Leader>n a^[[@,].]<Esc><Left><Left><Left>i
"Use vim's built-in file browser:
inoremap <C-b> <Esc>:Lex<CR>:vertical resize 30<CR>
nnoremap <C-b> <Esc>:Lex<CR>:vertical resize 30<CR>
"Clear higlighting:
nnoremap \\ :noh<cr> "
" Trim trailing spaces
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" ------Plug-ins:
"Plug-ins list:
call plug#begin(expand('~/.vim/pluged'))
Plug 'airblade/vim-gitgutter'
Plug 'jalvesaq/zotcite'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'michal-h21/vim-zettel'
Plug 'vimwiki/vimwiki'
call plug#end()
"fzf.vim
nmap <Leader>f :Files<CR>
"vim-zetterl
let g:nv_search_paths = ['$HOME/Desktop/vimwiki/']
"Colorscheme:
"
if has('termguicolors')
set termguicolors
let &t_8f = "\<Esc>[38:2::%lu:%lu:%lum"
let &t_8b = "\<Esc>[48:2::%lu:%lu:%lum"
endif
let g:solarized_termtrans = '1'
let g:solarized_italics = '0'
colorscheme solarized8
"Status line colors:
au InsertEnter * hi statusline guifg=black guibg=#d7afff ctermfg=black ctermbg=magenta
au InsertLeave * hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
"Status modes:
let g:currentmode={
\ 'n' : 'Normal',
\ 'no' : 'Normal·Operator Pending',
\ 'v' : 'Visual',
\ 'V' : 'V·Line',
\ "\<C-v>" : 'Visual·Block',
\ 's' : 'Select',
\ 'S' : 'S·Line',
\ '^S' : 'S·Block',
\ 'i' : 'Insert',
\ 'R' : 'Replace',
\ 'Rv' : 'V·Replace',
\ 'c' : 'Command',
\ 'cv' : 'Vim Ex',
\ 'ce' : 'Ex',
\ 'r' : 'Prompt',
\ 'rm' : 'More',
\ 'r?' : 'Confirm',
\ '!' : 'Shell',
\ 't' : 'Terminal'
\}
"Status modules:
set statusline=
set statusline+=%#WildMenu#
set statusline+=\ \ %{toupper(g:currentmode[mode()])}\
set statusline+=%1*\ %<%F%m%r%h%w\ [%{&spelllang}\]\
set statusline+=%#CursorLineNr#
set statusline+=\ %y\ %{&fileencoding?&fileencoding:&encoding}\
set statusline+=%1*\ ln:\ %02l/%L\ (%p%%)\ [col:%c]
set statusline+=%=
set statusline+=%#WildMenu#
set statusline+=\%0*\ %n\
"Goyo:
let g:goyo_width=90
let g:goyo_height=90
function! s:goyo_enter()
set cursorline nocursorcolumn
endfunction
function! s:goyo_leave()
set cursorline cursorcolumn
hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
"Vimwiki:
let g:vimwiki_list = [{'path': '~/Desktop/vimwiki/', 'syntax': 'markdown', 'ext': '.md', 'auto_diary_index': 1, 'auto_generate_links': 1, 'auto_generate_tags': 1, 'auto_tags': 1}]
let g:vimwiki_global_ext = 0
"Zotcite:
let zotcite_filetypes = ['markdown', 'pandoc', 'rmd', 'vimwiki']