-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdot_vimrc
More file actions
110 lines (87 loc) · 2.9 KB
/
Copy pathdot_vimrc
File metadata and controls
110 lines (87 loc) · 2.9 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
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
source $VIMRUNTIME/defaults.vim
let mapleader = "<space>"
set ignorecase
set diffopt+=iwhiteeol
set hlsearch
set number
set relativenumber
set cursorline
set list
set listchars=tab:▸·,trail:·
set shortmess+=I " don't show the welcome intro screen
set backup " keep a backup file (restore to previous version)
if has('persistent_undo')
set undofile " keep an undo file (undo changes after closing)
endif
" Directories for swp files (chezmoi ensure this directory exists)
set backupdir=~/.vim/backup
" nice statusbar
set laststatus=2
set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%m%r%w " flags
set statusline+=\[%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{&encoding}, " encoding
set statusline+=%{&fileformat}] " file format
if filereadable(expand("$HOME/.vim/plugin/fugitive.vim"))
set statusline+=%{fugitive#statusline()} " git branch}
endif
set statusline+=%= " right align
set statusline+=0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
set background=dark
colorscheme sorbet
" Load some useful packages
packadd nohlsearch
packadd hlyank
packadd osc52
" ================================================================================
" MAPPINGS
" general mappings
map <f2> :h quickref<cr>
" map Y to behave like it's counterparts (C, D, etc.), see the VIM docs for
" more info (type :h Y)
map Y y$
" TextMate simulated keystroke's for shifting width with a single keystroke
nmap <a-[> <<
nmap <a-]> >>
vmap <s-tab> <gv
vmap <tab> >gv
" clipboard shortcuts
vmap <f9> "+x
vmap <f11> "+y
nmap <f12> "+gP
imap <f12> <C-r>+
cmap <f12> <C-r>+
vmap <f12> "+p
map <f6> :set guifont=Lucida_Console:h20:cANSI:qDRAFT<cr>
" ================================================================================
" PLUGIN SETTINGS
" PLUGIN: NERDCommenter
" Align the comment characters in a single line, instead of as "arrow pattern"
let g:NERDDefaultAlign = 'left'
map <a-/> <plug>NERDCommenterToggle<cr>
" ================================================================================
" Legacy options, need to migrate these
set ts=2
set sw=2
set sts=2
set et
" ================================================================================
" Things from the example VIMRC file, need to check if I want to keep these
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
augroup END
" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
" The ! means the package won't be loaded right away but when plugins are
" loaded during initialization.
if has('syntax') && has('eval')
packadd! matchit
endif