-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
177 lines (157 loc) · 3.99 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
set nocompatible
let mapleader=" "
" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
call plug#begin('~/.vim/plugged')
"Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
Plug 'itchyny/lightline.vim'
Plug 'ap/vim-css-color'
Plug 'preservim/nerdtree'
Plug 'plasticboy/vim-markdown'
Plug 'mechatroner/rainbow_csv'
Plug 'tpope/vim-surround'
Plug 'liuchengxu/vim-which-key'
Plug 'mbbill/undotree'
Plug 'gyim/vim-boxdraw'
Plug 'vim-scripts/DrawIt'
Plug 'baskerville/vim-sxhkdrc'
Plug 'ackyshake/VimCompletesMe'
Plug 'morhetz/gruvbox'
Plug 'axvr/org.vim'
Plug 'mboughaba/i3config.vim'
"Plug 'jamessan/vim-gnupg'
"Plug 'jceb/vim-orgmode'
Plug 'markonm/traces.vim'
call plug#end()
" vimwiki
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
let g:vimwiki_global_ext = 0
" rainbow_csv
let g:rcsv_colorpairs = [['lightmagenta', 'lightmagenta'], ['green', 'green'], ['red', 'red'],
\ ['yellow', 'yellow'], ['cyan', 'cyan'], ['blue', 'blue'], ['darkyellow', 'darkyellow'],
\ ['darkred', 'darkred'], ['darkyellow', 'darkyellow'], ['darkcyan', 'darkcyan']]
let g:disable_rainbow_hover=1
let g:disable_rainbow_key_mappings=1
" lightline.vim
set laststatus=2
set noshowmode
set ttimeout
set ttimeoutlen=30
let g:lightline = {
\ 'colorscheme': 'powerline',
\ }
set number
set relativenumber
set hlsearch
set incsearch
set encoding=utf-8
set ignorecase
set smartcase
set mouse=a
set termguicolors
set softtabstop=4
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set wrap
set linebreak
set nofoldenable
set background=dark
set ruler
set cmdheight=1
set fileformat=unix
set wildmenu
set wildmode=longest,list,full
set wildignore=*.jpg,*.jpeg,*.png,*.gif,*.pdf,*.docx,*.mkv,*.mp4,*.webm,*.torrent
set splitbelow
set splitright
set ttymouse=sgr
set scrolloff=10
set nowrapscan
set history=1000
set clipboard=unnamedplus
vnoremap <C-c> "+y :let @+=@*<CR>
map <C-p> "+P
syntax on
filetype plugin on
filetype indent on
set autoread
autocmd FocusGained,BufEnter * checktime
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
autocmd BufWritePre * %s/\s\+$//e
" change cursor in different modes
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
let &t_SR = "\e[4 q"
" Avoid getting stuck in Ex mode
map Q <Nop>
map gQ <Nop>
" macros on multiple lines
function! ExecuteMacroOverVisualRange()
echo "@".getcmdline()
execute ":'<,'>normal @".nr2char(getchar())
endfunction
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
" // searches for the current selection in visual mode
vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR>
" leader key
nnoremap <leader>s :set spell spelllang=en_us<CR>
nnoremap <Leader>ns :set nospell<CR>
nnoremap <leader>h :nohlsearch<CR>
nnoremap <leader>u :UndotreeToggle<CR>
nnoremap <leader>f :filetype detect<CR>
nnoremap <leader>n :NERDTreeToggle<CR>
nnoremap <leader>w :w!<CR>
nnoremap <leader>q :q<CR>
nnoremap <Leader>r :source ~/.vimrc<CR>
" disable arrow keys
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" misc
nnoremap S :%s//g<Left><Left>
nnoremap <tab> >>
nnoremap # I#<Esc>
nnoremap Y y$
vnoremap # :norm 0i#<Esc>
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
" abbreviations
ab -> →
ab up. ↑
ab down. ↓
ab <- ←
ab a. α
ab b. β
ab g. γ
ab d. δ
ab D. Δ
ab half. ½
ab max. maximum
ab min. minimum
ab >. ≥
ab <. ≤
ab sh. #!/bin/sh
ab bash. #!/usr/bin/env bash
ab zsh. #!/usr/bin/env zsh
ab lua. #!/usr/bin/env lua
ab shk. # shellcheck disable=
ab filetype. # vim: filetype=
ab degc °C
ab degf °F
ab deg. °
ab pi. π
source ~/.config/specific/vimrc