-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvimrc
More file actions
97 lines (77 loc) · 2.71 KB
/
vimrc
File metadata and controls
97 lines (77 loc) · 2.71 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
"Load Pathogen-installed plugins.
runtime bundle/vim-pathogen/autoload/pathogen.vim
"Infect.
execute pathogen#infect()
"Display line numbers.
set number
"Display the status line always.
set laststatus=2
"Enable color syntax highlighting.
syntax on
"Customize indentation per file type.
"Uses indentation scripts located in the indent folder of the vim installation.
"Do not set smartindent if using this.
filetype plugin indent on
"Set colors.
set t_Co=256
"Take into consideration that there are Python-specific
"settings in ~/.vim/ftplugin/python.vim
"Syntastic settings.
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"Select Python checkers.
let g:syntastic_python_checkers = ['pycodestyle', 'pep8', 'flake8', 'pep8-naming', 'pyflakes']
" let g:syntastic_python_checkers = ['flake8', 'pep8', 'pep8-naming']
"Airline settings.
let g:airline#extensions#tabline#enabled = 1
"Set airline theme.
let g:airline_theme = 'powerlineish'
"Put swap files in /tmp to avoid git getting to see them.
"The double slash at the end makes the file name be built from the complete
"file path to ensure file name uniqueness.
set directory=/tmp//
"I type :X half of the times I feel like saving or quitting my file.
:command W w
:command Q w
"Keep cursor centered in file.
"Set scroll offset to a large value to keep the cursor in the middle.
set so=999
"Execute shell commands inside vim.
"Use this like so: :Shell ls -al
command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
function! s:RunShellCommand(cmdline)
echo a:cmdline
let expanded_cmdline = a:cmdline
for part in split(a:cmdline, ' ')
if part[0] =~ '\v[%#<]'
let expanded_part = fnameescape(expand(part))
let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '')
endif
endfor
botright new
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
call setline(1, 'You entered: ' . a:cmdline)
call setline(2, 'Expanded Form: ' .expanded_cmdline)
call setline(3,substitute(getline(2),'.','=','g'))
execute '$read !'. expanded_cmdline
setlocal nomodifiable
1
endfunction
"Show whitespace characters and newlines.
:set list listchars=tab:>-,eol:¶,trail:·
"Make it possible to copy from vim to the clipboard (requires gvim)
set clipboard=unnamedplus
"Increase the contrast for some selections that are unreadable otherwise
hi Spellbad term=reverse ctermbg=1
" Fix highlighting
hi QuickFixLine term=reverse ctermbg=0
colorscheme darkblue
colorscheme delek
:set hlsearch
" Set tabs for YAML
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab