-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc.symlink
109 lines (80 loc) · 2.36 KB
/
vimrc.symlink
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
" Minimal vim config for when neovim is not available
set nocompatible
filetype plugin indent on
" Be Pretty!
set t_Co=256
set background=dark
" UTF-8 FTW!
set encoding=utf-8
" Keep backup/swap centrally
set backupdir=~/.vim/backup
set dir=~/.vim/backup
set noswapfile
" Tabs == 2 spaces
set tabstop=2
set shiftwidth=2
set smartindent " Try to be clever vim
set expandtab " Spaces, not tabs
syntax enable " Syntax highlighting
set incsearch " Incremental search
set ignorecase " Case-insensitive search by default
set smartcase " Case-sensitive search if uppcase is used
set wildmenu " Turn on tab completion menu
set wildmode=list:longest " Make tab completion work like shell
set scrolloff=3 " Start scrolling viewport 3 lines ahead of cursor
set nofoldenable " No code folding
set number " Show line nunbers
set laststatus=2 " Status line on
set showmatch " Show matching braces
set nowrap " No line wrapping
set list " I like seeing invisible characters
" Set invisible characters
set listchars=tab:-∙,trail:∙,precedes:«,extends:»
" Faster autocomplete with less searching
set complete-=i
" Ignore these when globbing
set wildignore+=*.pyc,*.log,*.otf,*.woff
" STFU Bells
set noerrorbells
set novisualbell
set t_vb=
autocmd! GUIEnter * set vb t_vb=
"""""""""""""""""
" Misc Mappings "
"""""""""""""""""
" Change the leader
let mapleader = ","
let g:mapleader = ","
" =j indents as JSON
nmap =j :%!jq .<CR>
" Expand %% into the current directory of the current file
cnoremap %% <C-R>=expand('%:h').'/'<cr>
" Remove extra whitespace
nmap <leader><space> :%s/\s\+$<cr>
" leader+r executes file
nnoremap <leader>r :!%:p
"""""""""""""""""""
" / Misc Mappings "
"""""""""""""""""""
""""""""""""""""""""
" Buffer Shortcuts "
""""""""""""""""""""
" Next Buffer
nmap <leader>n :bn<cr>
" Previous Buffer
nmap <leader>p :bp<cr>
" Switch between current and last buffer
nmap <leader>. <c-^>
nmap <leader>, <c-^>
""""""""""""""""""""""
" / Buffer Shortcuts "
""""""""""""""""""""""
""""""""""""""""""""
" Window Shortcuts "
""""""""""""""""""""
" Resize vertical splits
map <silent> <C-l> <C-w><
map <silent> <C-h> <C-w>>
""""""""""""""""""""""
" / Window Shortcuts "
""""""""""""""""""""""