52 lines
915 B
VimL
52 lines
915 B
VimL
set nocompatible
|
|
|
|
colorscheme elflord
|
|
|
|
syntax enable
|
|
|
|
set showmatch
|
|
set nu
|
|
set relativenumber
|
|
set incsearch
|
|
set hlsearch
|
|
set tabstop=2
|
|
set softtabstop=0
|
|
set expandtab
|
|
set shiftwidth=2
|
|
set smarttab
|
|
set clipboard=unnamedplus
|
|
set shell=bash
|
|
|
|
nnoremap tn :tabnew<Space>
|
|
nnoremap tk :tabnext<CR>
|
|
nnoremap tj :tabprev<CR>
|
|
nnoremap th :tabfirst<CR>
|
|
nnoremap tl :tablast<CR>
|
|
|
|
let mapleader = ","
|
|
|
|
set wrap linebreak nolist
|
|
|
|
nnoremap <leader>hl :nohls
|
|
|
|
function! Smart_TabComplete()
|
|
let line = getline('.')
|
|
let substr = strpart(line, -1, col('.')+1)
|
|
let substr = matchstr(substr, "[^ \t]*$")
|
|
if (strlen(substr)==0)
|
|
return "\<tab>"
|
|
endif
|
|
let has_period = match(substr, '\.') != -1
|
|
let has_slash = match(substr, '\/') != -1
|
|
if (!has_period && !has_slash)
|
|
return "\<C-X>\<C-P>"
|
|
" elseif ( has_slash )
|
|
else
|
|
return "\<C-X>\<C-F>"
|
|
endif
|
|
endfunction
|
|
|
|
inoremap <tab> <c-r>=Smart_TabComplete()<CR>
|
|
|
|
|