-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.vimrc
94 lines (74 loc) · 1.98 KB
/
.vimrc
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
"syntax highlighting
syntax on
set background=dark
"colorscheme molokai
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
"backup
"set backup
"set backupdir=~/.vim/backup,.,~/
"Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
set re=0
"Set to auto read when a file is changed from the outside
set autoread
"temp
set directory=/tmp,.
"incremental search
set incsearch
"completion of commands
set wildchar=<Tab>
set wildmenu
set wildmode=longest:full,full
"highlight the second bracket
set showmatch
"How many tenths of a second to blink when matching brackets
set mat=2
"Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
"Remember info about open buffers on close
set viminfo^=%
"spaces instead of tab
set expandtab
set tabstop=2
set shiftwidth=2
"F10 for switching between paste and nopaste mode
set pastetoggle=<F10>
"Always show current position
set ruler
"Ignore case when searching
set ignorecase
"Always show the status line
set laststatus=2
"Format the status line
"set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
"scala https://raw.githubusercontent.com/derekwyatt/vim-scala/master/syntax/scala.vim
au BufRead,BufNewFile *.scala set filetype=scala
au! Syntax scala source ~/.vim/syntax/scala.vim
" for `vim /foo/file:42` feature, use: https://github.com/bogado/file-line (https://raw.githubusercontent.com/bogado/file-line/master/plugin/file_line.vim)
" Wrap visual selection in an XML comment
vmap <Leader>c <Esc>:call CommentWrap()<CR>
function! CommentWrap()
normal `>
if &selection == 'exclusive'
exe "normal i-->"
else
exe "normal a-->"
endif
normal `<
exe "normal i<!--"
normal `<
endfunction
" Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction