retab to 2-space indent
This commit is contained in:
parent
b0755cf9fe
commit
3eabe33eeb
156
vimrc
156
vimrc
@ -40,31 +40,31 @@ nnoremap K :Man <cword><CR>
|
|||||||
let g:qnamebuf_hotkey = "<C-s>"
|
let g:qnamebuf_hotkey = "<C-s>"
|
||||||
|
|
||||||
if has("gui_running")
|
if has("gui_running")
|
||||||
" GUI-specific settings
|
" GUI-specific settings
|
||||||
colorscheme ir_black
|
colorscheme ir_black
|
||||||
set scrolloff=8
|
set scrolloff=8
|
||||||
set guioptions-=m " remove menu bar
|
set guioptions-=m " remove menu bar
|
||||||
set guioptions-=T " remove toolbar
|
set guioptions-=T " remove toolbar
|
||||||
set colorcolumn=80
|
set colorcolumn=80
|
||||||
set nomousehide
|
set nomousehide
|
||||||
hi ColorColumn guibg=#220000
|
hi ColorColumn guibg=#220000
|
||||||
set showtabline=2
|
set showtabline=2
|
||||||
let &titlestring=tolower(substitute(v:servername, "\\d$", "", "")) . ": %t%m (%{expand('%:p:h')})"
|
let &titlestring=tolower(substitute(v:servername, "\\d$", "", "")) . ": %t%m (%{expand('%:p:h')})"
|
||||||
else
|
else
|
||||||
" console-specific settings
|
" console-specific settings
|
||||||
set scrolloff=4
|
set scrolloff=4
|
||||||
set showtabline=1
|
set showtabline=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if has("win32") || has("win64")
|
if has("win32") || has("win64")
|
||||||
set directory=$TMP
|
set directory=$TMP
|
||||||
if filereadable('C:/cygwin/bin/bash.exe')
|
if filereadable('C:/cygwin/bin/bash.exe')
|
||||||
set shell=C:/cygwin/bin/bash.exe
|
set shell=C:/cygwin/bin/bash.exe
|
||||||
set shellcmdflag=--login\ -c
|
set shellcmdflag=--login\ -c
|
||||||
let $CHERE_INVOKING=1
|
let $CHERE_INVOKING=1
|
||||||
endif
|
endif
|
||||||
set guifont=Consolas:h11:cANSI
|
set guifont=Consolas:h11:cANSI
|
||||||
set linespace=0
|
set linespace=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" mappings
|
" mappings
|
||||||
@ -132,9 +132,9 @@ if has("autocmd")
|
|||||||
autocmd BufEnter * if bufname('%') == '' | set bufhidden=wipe | endif
|
autocmd BufEnter * if bufname('%') == '' | set bufhidden=wipe | endif
|
||||||
|
|
||||||
if has("gui_running")
|
if has("gui_running")
|
||||||
autocmd WinLeave * set nocursorline nocursorcolumn
|
autocmd WinLeave * set nocursorline nocursorcolumn
|
||||||
autocmd WinEnter * set cursorline cursorcolumn
|
autocmd WinEnter * set cursorline cursorcolumn
|
||||||
set cursorline cursorcolumn
|
set cursorline cursorcolumn
|
||||||
end
|
end
|
||||||
|
|
||||||
" When editing a file, always jump to the last known cursor position.
|
" When editing a file, always jump to the last known cursor position.
|
||||||
@ -156,75 +156,75 @@ endif " has("autocmd")
|
|||||||
|
|
||||||
" LoadProject - Searches for and loads project specific settings
|
" LoadProject - Searches for and loads project specific settings
|
||||||
function! LoadProject()
|
function! LoadProject()
|
||||||
if exists("b:project_loaded") && b:project_loaded == 1
|
if exists("b:project_loaded") && b:project_loaded == 1
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let projfile = findfile("project.vim", ".;")
|
let projfile = findfile("project.vim", ".;")
|
||||||
if projfile != ""
|
if projfile != ""
|
||||||
let b:project_directory = fnamemodify(projfile, ":p:h")
|
let b:project_directory = fnamemodify(projfile, ":p:h")
|
||||||
exec "source " . fnameescape(projfile)
|
exec "source " . fnameescape(projfile)
|
||||||
let b:project_loaded = 1
|
let b:project_loaded = 1
|
||||||
else
|
else
|
||||||
let projdir = finddir("project.vim", ".;")
|
let projdir = finddir("project.vim", ".;")
|
||||||
if projdir != ""
|
if projdir != ""
|
||||||
let b:project_directory = fnamemodify(projdir, ":p:h:h")
|
let b:project_directory = fnamemodify(projdir, ":p:h:h")
|
||||||
for f in split(glob(projdir . '/*.vim'), '\n')
|
for f in split(glob(projdir . '/*.vim'), '\n')
|
||||||
exec 'source ' . fnameescape(f)
|
exec 'source ' . fnameescape(f)
|
||||||
endfor
|
endfor
|
||||||
let b:project_loaded = 1
|
let b:project_loaded = 1
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ProjectCD - Change to the project directory
|
" ProjectCD - Change to the project directory
|
||||||
" for some reason doing this in LoadProject() didn't work on Windows
|
" for some reason doing this in LoadProject() didn't work on Windows
|
||||||
function! ProjectCD()
|
function! ProjectCD()
|
||||||
if exists("b:project_directory")
|
if exists("b:project_directory")
|
||||||
exec "cd " . fnameescape(b:project_directory)
|
exec "cd " . fnameescape(b:project_directory)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FindSymbolInSources(sources, ...)
|
function! FindSymbolInSources(sources, ...)
|
||||||
if a:0 > 0
|
if a:0 > 0
|
||||||
let sym = a:1
|
let sym = a:1
|
||||||
else
|
else
|
||||||
let sym = expand("<cword>")
|
let sym = expand("<cword>")
|
||||||
endif
|
endif
|
||||||
exec 'vimgrep /\<' . sym . '\>/gj ' . a:sources
|
exec 'vimgrep /\<' . sym . '\>/gj ' . a:sources
|
||||||
let n_matches = len(getqflist())
|
let n_matches = len(getqflist())
|
||||||
if n_matches == 0
|
if n_matches == 0
|
||||||
cclose
|
cclose
|
||||||
else
|
else
|
||||||
redraw " the following echo will be lost without redrawing here
|
redraw " the following echo will be lost without redrawing here
|
||||||
echo "Found " . n_matches . " matches"
|
echo "Found " . n_matches . " matches"
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" PtagSymbolBeforeParen - can be called from insert mode when the cursor
|
" PtagSymbolBeforeParen - can be called from insert mode when the cursor
|
||||||
" is anywhere within the parentheses of a function call in order to open
|
" is anywhere within the parentheses of a function call in order to open
|
||||||
" the called-function's prototype in the Preview window using :ptag
|
" the called-function's prototype in the Preview window using :ptag
|
||||||
function! PtagSymbolBeforeParen()
|
function! PtagSymbolBeforeParen()
|
||||||
let l:line = getline(".")
|
let l:line = getline(".")
|
||||||
let l:paren_pos = strridx(l:line, "(", col("."))
|
let l:paren_pos = strridx(l:line, "(", col("."))
|
||||||
if l:paren_pos != -1
|
if l:paren_pos != -1
|
||||||
let l:line = strpart(l:line, 0, l:paren_pos)
|
let l:line = strpart(l:line, 0, l:paren_pos)
|
||||||
endif
|
endif
|
||||||
let l:symidx = match(l:line, '\v[a-zA-Z_][a-zA-Z_0-9]*$')
|
let l:symidx = match(l:line, '\v[a-zA-Z_][a-zA-Z_0-9]*$')
|
||||||
if l:symidx != -1
|
if l:symidx != -1
|
||||||
let l:line = strpart(l:line, l:symidx)
|
let l:line = strpart(l:line, l:symidx)
|
||||||
endif
|
endif
|
||||||
if &syntax == 'vim'
|
if &syntax == 'vim'
|
||||||
execute 'silent! help ' . l:line
|
execute 'silent! help ' . l:line
|
||||||
if &filetype == 'help'
|
if &filetype == 'help'
|
||||||
" we successfully opened the help window
|
" we successfully opened the help window
|
||||||
execute "normal 1000\<C-w>-"
|
execute "normal 1000\<C-w>-"
|
||||||
setlocal winheight=10
|
setlocal winheight=10
|
||||||
execute "normal \<C-w>\<C-w>"
|
execute "normal \<C-w>\<C-w>"
|
||||||
startinsert
|
startinsert
|
||||||
endif
|
|
||||||
else
|
|
||||||
execute 'silent! ptag ' . l:line
|
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
execute 'silent! ptag ' . l:line
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! Tedit()
|
function! Tedit()
|
||||||
@ -252,5 +252,5 @@ command! Tedit call Tedit()
|
|||||||
" Machine-local Settings
|
" Machine-local Settings
|
||||||
"==============================================================================
|
"==============================================================================
|
||||||
if filereadable($MYVIMRC . ".local")
|
if filereadable($MYVIMRC . ".local")
|
||||||
exec 'source ' . $MYVIMRC . ".local"
|
exec 'source ' . $MYVIMRC . ".local"
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user