-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.txt
More file actions
77 lines (60 loc) · 2.18 KB
/
vimrc.txt
File metadata and controls
77 lines (60 loc) · 2.18 KB
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
" A simple vimrc. No addons or plugins needed.
" I use this on all linux systems for work.
" elflord is nice :-)
colorscheme elflord
" Search as characters are entered.
set incsearch
" Use cp to yank the name of current file.
" https://stackoverflow.com/questions/916875/yank-file-name-path-of-current-buffer-in-vim
map cp :let @" = expand("%:p")<cr>
" delete the current file
nnoremap df :call delete(expand('%:p')) \| bdelete!<CR>
" Some distros (fedora) default to syntax on.
" Others (Debian) need to be told.
" Just force it on.
syntax on
" enable row and col number in bottom right
set ruler
" on win10 ubuntu subsystem, and new mac osx need to manually set this for some reason
set hlsearch
" Open new split panes to right and bottom, which feels more natural
" than Vim’s default:
" https://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally
set splitbelow
set splitright
" Fast and simple way to move between panes:
" http://stackoverflow.com/questions/6053301/easier-way-to-navigate-between-vim-split-panes
map <C-up> <C-w><up>
map <C-down> <C-w><down>
map <C-left> <C-w><left>
map <C-right> <C-w><right>
" Flip through quickfix list with ctrl+j and ctrl+k. This way I can
" grep for a pattern from vim, then flip through results quickly.
map <C-j> :cn<CR>
map <C-k> :cp<CR>
" Flip through tabs with shift+t
nnoremap T gt
" Allow hidden buffer in background:
" https://nvie.com/posts/how-i-boosted-my-vim/
set hidden
" Vim includes a man page viewer, :Man, in its runtime files.
runtime! ftplugin/man.vim
" Setting the visual bell turns off the audio bell, and clearing the
" visual bell length deactivates flashing:
" https://stackoverflow.com/a/44124913
set visualbell
set t_vb=
" search for columns wider than 79
" This replaces the Ex mode activation with Q
" https://vim.fandom.com/wiki/Highlight_long_lines#Searching
noremap Q /\%>79v.\+
" Set color column, and make it green (not easy being green)
" https://superuser.com/a/249856
set colorcolumn=80
highlight ColorColumn ctermbg=green
" Change color scheme if using ssh.
" Sometimes colors get weird depending on where
" I'm ssh'ing in from. Usually not an issue though.
"if $SSH_CONNECTION
"colorscheme desert
"endif