-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
167 lines (132 loc) · 4.24 KB
/
.vimrc
File metadata and controls
167 lines (132 loc) · 4.24 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
set nocompatible " be iMproved, required
filetype off " required
" Help windows find ~/.vim
if has('win32') || has('win64')
set guifont=Consolas:h10
set runtimepath+=~/.vim
set runtimepath+=~/.vim/after
endif
filetype plugin indent on " required
syntax on
let g:CSApprox_verbose_level = 0
" Set the colorscheme to something nice "
let g:molokai_original = 1
colorscheme molokai
" Enable window title "
set title
" Show the commands entered in normal mode "
set showcmd
" Show the cursor position "
set ruler
" Highlight all search matches "
set hlsearch
" Stop comments from continuing onto the next line "
set formatoptions-=ro
set autoindent
set nosmartindent
set noet
set tabstop=4
set shiftwidth=4
" Use smart case sensitive searching "
set ignorecase
set smartcase
" Enable tab completion for commands "
set wildmode=longest,list,full
set wildmenu
" Set and show whitespace characters "
set listchars=eol:$,tab:»\ ,trail:.,extends:>,precedes:<,nbsp:.
" Ensure backspace always works as expected "
set backspace=2
" Stop tilde backup files from being created in the current dir
set backupdir=~/.vim/backup//
" Disable swap file creation
set noswapfile
" Make linespace 2 to stop disappearing underscores
set linespace=2
" Relative line numbers
set number
set relativenumber
" Set C switch indenting to follow statement position, not curley braces
set cinoptions=l1
" Maintain window split proportions on resize
au VimResized * wincmd =
" Unmap Ex mode key combination "
:map Q <Nop>
" Make the ctrl left and right arrows move one word at a time
nnoremap <silent> <C-Left> b
nnoremap <silent> <C-Right> w
" Press Space to turn off highlighting and clear any message already displayed.
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
function! SetupPython()
" Here, you can have the final say on what is set. So
" fixup any settings you don't like.
set noet
set softtabstop=4
set tabstop=4
set shiftwidth=4
set expandtab
endfunction
command! -bar SetupPython call SetupPython()
function! GuiTabLabel()
return exists('t:mytablabel') ? t:mytablabel : ''
endfunction
:set guitablabel=%{GuiTabLabel()}
:set go+=e
"inoremap <Up> <NOP>
"inoremap <Down> <NOP>
"inoremap <Left> <NOP>
"inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Enable all python syntax highlighting
let g:python_highlight_all = 1
" Disable concel mode in json plugin
let g:vim_json_syntax_conceal = 0
" Set yaml syntax highlighting on ocio configs
autocmd BufNewFile,BufRead *.ocio set syntax=yaml
" Set json syntax highlighting on eco3 files
autocmd BufNewFile,BufRead *.eco3 set filetype=json
inoremap jk <Esc>
" Scale the font size with Alt +
if has("unix")
function! FontSizePlus ()
let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole + 1
let l:new_font_size = ' '.l:gf_size_whole
let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
endfunction
function! FontSizeMinus ()
let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole - 1
let l:new_font_size = ' '.l:gf_size_whole
let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
endfunction
else
function! FontSizePlus ()
let l:gf_size_whole = matchstr(&guifont, '\(:h\)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole + 1
let l:new_font_size = ':h'.l:gf_size_whole
let &guifont = substitute(&guifont, ':h\d\+$', l:new_font_size, '')
endfunction
function! FontSizeMinus ()
let l:gf_size_whole = matchstr(&guifont, '\(:h\)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole - 1
let l:new_font_size = ':h'.l:gf_size_whole
let &guifont = substitute(&guifont, ':h\d\+$', l:new_font_size, '')
endfunction
endif
if has("gui_running")
noremap = :call FontSizePlus()<CR>
noremap - :call FontSizeMinus()<CR>
endif
" This stupidly complicated function lets me use * search but without stopping
" on fullstops or hyphens without breaking regular 'w' functionality
function! SuperStar ()
set iskeyword+=.,-
let @/ = expand("<cword>")
set iskeyword-=.,-
call feedkeys("n")
endfunction
:nnoremap * :call SuperStar()<CR>