Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set t_Co=256
- let g:debuggerPort = 62343
- syntax enable
- "set background=dark
- " Highlight trailing whitespace and tabs
- colorscheme molokai
- highlight TrailingSpaces ctermbg=yellow
- match TrailingSpaces /\s\+$\| \+$\|\t\+$/
- set number
- highlight ExtraWhitespace ctermbg=yellow guibg=yellow
- match ExtraWhitespace /\s\+$/
- autocmd FileType c,cpp,java,php,ruby,python,perl,yaml autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
- " Set the leader key
- let mapleader = ","
- " Map w!! to write file with sudo, when forgot to open with sudo.
- cmap w!! w !sudo tee % >/dev/null
- " Map F1 to Esc. Safe to remove if not desirable.
- inoremap <F1> <ESC>
- nnoremap <F1> <ESC>
- vnoremap <F1> <ESC>
- " Display a place holder character for tabs and trailing spaces
- " set list
- " set listchars=trail:⋅,nbsp:⋅,tab:▷⋅
- " Enable plugins and indentation based on filetype
- filetype plugin indent on
- " Enable filetype detection
- setlocal foldmethod=indent
- setlocal nofoldenable
- setlocal foldlevel=1
- setlocal foldnestmax=10
- " Remove highlighting search results
- nnoremap <leader><space> :noh <CR>
- " Set the keys to turn spell checking on/off
- map <F8> <Esc>:setlocal spell spelllang=en_us<CR>
- map <F9> <Esc>:setlocal nospell<CR>
- " Set the key to toggle NERDTree
- nnoremap <leader>d :NERDTreeToggle<cr>
- " set Enter/Return to activate a node
- let NERDTreeMapActivateNode='<CR>'
- let NERDTreeShowHidden=1
- function! Smart_TabComplete()
- let line = getline('.')
- let substr = strpart(line, -1, col('.')+1)
- let substr = matchstr(substr, "[^ \t]*$")
- if(col('.')==1)
- return "\<tab>"
- endif
- 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 )
- return "\<C-X>\<C-F>"
- else
- return "\<C-X>\<C-O>"
- endfunction
- " inoremap <tab> <c-r>=Smart_TabComplete()<CR>
- function! <SID>StripTrailingWhitespaces()
- let _s=@/
- let l = line(".")
- let c = col(".")
- %s/\s\+$//e
- let @/=_s
- call cursor(l, c)
- endfunction
- set pastetoggle=<F2>
- set ignorecase
- set smartcase
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement