-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
174 lines (149 loc) · 4.79 KB
/
Copy pathvimrc
File metadata and controls
174 lines (149 loc) · 4.79 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
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
" more stuff in https://github.com/DAddYE/dotfiles/blob/master/.vim/vimrc
set nocompatible
" set iskeyword=@,48-57,_,192-255,#
" create a backup of files when editing in /tmp
set backupdir=~/tmp
" swap file directory
set dir=/tmp
set backspace=indent,eol,start
" get rid of toolbar
"set guioptions-=T
" no menu bar
set guioptions=-m
set autoindent
set ignorecase
set ruler
set showmatch
set showmode
set tabstop=4
set softtabstop=4
set number
set shiftwidth=4
set hlsearch
set incsearch
set expandtab
set paste
syntax on
set wmnu
" Completion: http://www.vim.org/scripts/script.php?script_id=2620
let g:neocomplcache_enable_at_startup = 1
" Python
autocmd FileType python set complete+=k~/.vim/syntax/python.vim
" Execute file being edited with <Shift> + e:
map <buffer> <S-e> :w<CR>:!/usr/bin/env python % <CR>
" pydiction
let g:pydiction_location = '~/.vim/pydiction/complete-dict'
"
" set GUI font
command F set guifont=Monaco:h13
command G set guifont=Monaco:h16
" do some spell checking by default
autocmd BufEnter *.txt set spell
autocmd BufEnter *.txt set linebreak
" don't like folds in MD files
" autocmd FileType markdown setlocal foldmethod=manual
autocmd FileType markdown setlocal foldlevel=99
" https://github.com/junegunn/vim-plug
call plug#begin('~/.vim/plugged')
"
" " Make sure you use single quotes
"
" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
"
" " Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
" Markdown
Plug 'godlygeek/tabular'
Plug 'preservim/vim-markdown'
"
" " Multiple Plug commands can be written in a single line using | separators
"Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
"
" " On-demand loading
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
"
" " Using a non-default branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
"
" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }
"
" " Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
"
" " Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
"
" " Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'
" https://github.com/ghifarit53/tokyonight-vim
Plug 'ghifarit53/tokyonight-vim'
call plug#end()
" Color Scheme
" https://github.com/ghifarit53/tokyonight-vim
set termguicolors
let g:tokyonight_style = 'night' " available: night, storm
let g:tokyonight_enable_italic = 1
colorscheme tokyonight
" Taglist variables
" Install ctags from:
" http://code.google.com/p/rudix/downloads/detail?name=ctags-5.8-1.dmg&can=2&q=label%3ARudix-2011
" Display function name in status bar:
let g:ctags_statusline=1
" Automatically start script
let generate_tags=1
nnoremap TT :TlistToggle<CR>
" Displays taglist results in a vertical window:
let Tlist_Use_Horiz_Window=0
let Tlist_Use_Right_Window = 1
let Tlist_Compact_Format = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_File_Fold_Auto_Close = 0
" WDIFF:
"augroup wdiff
" autocmd BufRead *.wdiff :source $VIMRUNTIME/syntax/wdiff.vim
" autocmd BufRead *.wdiff map <F3> df]x
" autocmd BufRead *.wdiff map <F4> xxf+xx
"augroup END
"Mail:
autocmd BufRead,BufNewFile *.mail setfiletype mail
" Shell Scripts:
" automatically insert "#!/bin/bash" line for *.sh files
"au BufEnter *.sh if getline(1) == "" | :call setline(1, "#!/bin/bash") | endif
" " automatically give executable permissions if file begins with #!/bin/sh
"au BufWritePost * if getline(1) =~ "^#!/bin/[a-z]*sh" | silent !chmod a+x <afile> | endif
"map <F5> :.,+10s/^/ /g<CR>
" HTML/XML:
" :au Filetype html,xml,xsl source ~/.vim/closetag.vim
":au Filetype xml source ~/.vim/xml.vim
"au! BufRead,BufNewFile *.json setfiletype json
":au Filetype json source ~/.vim/json.vim
" XML NEW: http://www.pinkjuice.com/howto/vimxml/setup.xml
let mapleader = ","
let $ADDED = '~/.vim'
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
filetype plugin on
" C-S saves the file.
" If C-S is not assigned to anything, some terminals will hang
" when pressing those keys.
"noremap <C-S> :w<CR>
"inoremap <C-S> <C-O>:w<CR>
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
"autocmd BufReadPost *
" \ if line("'\"") > 0 && line("'\"") <= line("$") |
" \ exe "normal g`\"" |
" \ endif
" from http://www.vim.org/tips/tip.php?tip_id=1030 use :Diff
"function! s:DiffWithSaved()
" diffthis
" new | r # | normal 1Gdd
"" diffthis
" setlocal bt=nofile bh=wipe nobl noswf ro
"endfunction
"com! Diff call s:DiffWithSaved()