-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvimrc-slim
More file actions
107 lines (98 loc) · 2.97 KB
/
vimrc-slim
File metadata and controls
107 lines (98 loc) · 2.97 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
set nocompatible
set backspace=indent,eol,start
set noswapfile
set history=500
set nobackup
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set winheight=999
set wmh=0 " split don't have that xtra line
syntax on
set autoindent
set incsearch
set hlsearch
set autoread
set ignorecase
set number
set scrolloff=3
set nofoldenable " Say no to code folding...
let $BASH_ENV = "~/.bash_profile"
let mapleader = ","
map <leader>ns :setlocal nospell<CR>
map <leader>ss :setlocal spell<CR>
map <leader>nl :set invnumber<CR>
map <Leader>vi :tabe ~/.vimrc<CR>
map <Leader>vr :rightbelow vnew
map <Leader>wd :setlocal textwidth=78<CR>
map <Leader>rg :reg<CR>
map <Leader>rn :call RenameFile()<cr>
map <Leader>pp :set paste<CR>o<esc>"*]p:set nopaste<cr> " paste from clipboard
map <Leader>ee :e <C-R>=expand("%:p:h") . '/'<CR>
map <Leader>se :split <C-R>=expand("%:p:h") . '/'<CR>
map <Leader>ve :vnew <C-R>=expand("%:p:h") . '/'<CR>
colorscheme murphy
map <C-h> :nohl<cr>
map <C-s> <esc>:w<CR>
imap <C-s> <esc>:w<CR>
" Make 'Y' consistent with 'C' & 'D'
nnoremap Y y$
map <leader>w <c-w>w " Switch/toggle between split windows
map <leader>h <c-w>h<c-w><cr> " Go to left vertical split
map <leader>l <c-w>l<c-w><cr> " Go to right vertical split
map <S-j> <C-W>j<C-W>_ " Go down horz split
map <S-k> <C-W>k<C-W>_ " Go up horz split
map <S-h> gT
map <S-l> gt
" ---- Toggle between the last two active tabs
let g:lasttab = 1
nmap <Leader>t :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
" Show tab number on the tabline
if exists("+showtabline")
function! MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= ' '
let s .= i . ')'
"let s .= winnr . '/' . tabpagewinnr(i,'$')
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let file = bufname(buflist[winnr - 1])
let file = fnamemodify(file, ':p:t')
if file == ''
let file = '[No Name]'
endif
let s .= file
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
endif
map Q gq
function! RenameFile()
let old_name = expand('%')
let new_name = input('New file name: ', expand('%'), 'file')
if new_name != '' && new_name != old_name
exec ':saveas ' . new_name
exec ':silent !rm ' . old_name
redraw!
endif
endfunction
set noesckeys
set ttimeout
set ttimeoutlen=1
highlight Search ctermbg=darkgreen ctermfg=white cterm=NONE
highlight StatusLine ctermbg=Gray ctermfg=DarkRed cterm=NONE
highlight StatusLineNC ctermbg=Gray ctermfg=DarkBlue cterm=NONE