-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc-WSL
72 lines (69 loc) · 1.92 KB
/
.vimrc-WSL
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
""""""""""""""""""""""""""""""""
" Rudy Faile @rfaile313 .vimrc "
" ~~~~~~~~~ WSL ~~~~~~~~~ "
""""""""""""""""""""""""""""""""
set number
set showcmd
set wildmenu
set bs=2
set encoding=utf-8
set modelines=0
set nowrap
" flash instead of beep
set visualbell
" note(rudy) turn paste and line wrap off for a bit
"set paste " uncomment or set manually for no line wrap
"set textwidth=100 " stops at col 100
set shiftwidth=4
set tabstop=4
set softtabstop=4
set scrolloff=3
" smarter backspace
set backspace=indent,eol,start
" auto indentation
set autoindent
" mouse scrolling :>
set mouse=a
set history=500
set ignorecase
set smartcase
set hlsearch " highlight searches
" show next matched text center of screen
nnoremap n nzz
nnoremap N Nzz
set showmatch " brackets/cursors
set mat=2
" Cursor block
let &t_SI.="\e[5 q"
let &t_SR.="\e[4 q"
let &t_EI.="\e[1 q"
" Don't autocomment
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Remaps -----------------
" Remap q to Q (macro)
nnoremap Q q
nnoremap q <Nop>
" move between windows with ctrl <-- -->
nmap <silent> <C-Right> :wincmd l<CR>
nmap <silent> <C-Left> :wincmd h<CR>
" remove highlighting after search with comma-space
nnoremap <silent> ,<space> :nohlsearch<CR>
" Open :Explore iwith ctrl+e in normal mode
nnoremap <silent> <C-E> :Explore<CR>
" all that is needed for any color scheme in vim is to place in
" ~/.vim/colors --- e.g. ~/.vim/colors/sonokai.vim
colorscheme sonokai
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Indent if we're at the beginning of a line. Else, do completion.
"NOTE(Rudy): DOES NOT WORK WITH :set paste
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <expr> <tab> InsertTabWrapper()
inoremap <s-tab> <c-n>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""