Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- syntax on
- set smartindent
- set tabstop=4
- set shiftwidth=4
- set expandtab
- set nobackup
- set nowritebackup
- set noswapfile
- set nu
- set autoread
- set backspace=eol,start,indent
- set whichwrap+=<,>,h,l
- set ignorecase
- set smartcase
- set hlsearch
- set incsearch
- set mouse=a
- " Uncomment this if you don't want misspelled words to be highlighted
- set spell spelllang=en_us
- set ai "Auto indent
- set si "Smart indent
- set wrap "Wrap lines
- highlight OverLength ctermbg=red ctermfg=white guibg=#592929
- match OverLength /\%81v.\+/
- " 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^=%
- """"""""""""""""""""""""""""""
- " => Status line
- """"""""""""""""""""""""""""""
- " 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
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => Helper functions
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- function! CmdLine(str)
- exe "menu Foo.Bar :" . a:str
- emenu Foo.Bar
- unmenu Foo
- endfunction
- function! VisualSelection(direction) range
- let l:saved_reg = @"
- execute "normal! vgvy"
- let l:pattern = escape(@", '\\/.*$^~[]')
- let l:pattern = substitute(l:pattern, "\n$", "", "")
- if a:direction == 'b'
- execute "normal ?" . l:pattern . "^M"
- elseif a:direction == 'gv'
- call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.')
- elseif a:direction == 'replace'
- call CmdLine("%s" . '/'. l:pattern . '/')
- elseif a:direction == 'f'
- execute "normal /" . l:pattern . "^M"
- endif
- let @/ = l:pattern
- let @" = l:saved_reg
- endfunction
- " Returns true if paste mode is enabled
- function! HasPaste()
- if &paste
- return 'PASTE MODE '
- en
- return ''
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement