Narven
2/9/2015 - 9:58 AM

my vim

my vim

" in ~/.vimrc

set tabstop=4      " Number of spaces that a <Tab> in the file counts for.

set shiftwidth=4    " Number of spaces to use for each step of (auto)indent.

set expandtab       " Use the appropriate number of spaces to insert a <Tab>.
                    " Spaces are used in indents with the '>' and '<' commands
                    " and when 'autoindent' is on. To insert a real tab when
                    " 'expandtab' is on, use CTRL-V <Tab>.

set smarttab        " When on, a <Tab> in front of a line inserts blanks
                    " according to 'shiftwidth'. 'tabstop' is used in other
                    " places. A <BS> will delete a 'shiftwidth' worth of space
                    " at the start of the line.

set showcmd         " Show (partial) command in status line.

let g:netrw_liststyle=3

cmap w!! w !sudo tee %

map + <C-W>+
map - <C-W>-
map - :Explore<cr>  " map explore to - minus key

map <c-j> j<c-e>
map <c-k> k<c-y>

map <c-l> :tabnext<enter>
map <c-h> :tabprevious<enter>

map <S-D-Right> :tabnext<cr>
map <S-D-Left> :tabprevious<cr>

"set nu              " for line numbers in the left margin.
"set cul             " highlights the line containing the cursor.

set number          " Show line numbers.

set showmatch       " When a bracket is inserted, briefly jump to the matching
                    " one. The jump is only done if the match can be seen on the
                    " screen. The time to show the match can be set with
                    " 'matchtime'.

set hlsearch        " When there is a previous search pattern, highlight all
                    " its matches.

set incsearch       " While typing a search command, show immediately where the
                    " so far typed pattern matches.

set ignorecase      " Ignore case in search patterns.

set smartcase       " Override the 'ignorecase' option if the search pattern
                    " contains upper case characters.

set backspace=2     " Influences the working of <BS>, <Del>, CTRL-W
                    " and CTRL-U in Insert mode. This is a list of items,
                    " separated by commas. Each item allows a way to backspace
                    " over something.
                    
set textwidth=79    " Maximum width of text that is being inserted. A longer
                    " line will be broken after white space to get this width.

set ruler           " Show the line and column number of the cursor position,
                    " separated by a comma.

set background=dark " When set to "dark", Vim will try to use colors that look
                    " good on a dark background. When set to "light", Vim will
                    " try to use colors that look good on a light background.
                    " Any other value is illegal.

set mouse=a         " Enable the use of the mouse.




filetype plugin indent on
syntax on

" =================== BACKUP

set backup              " Make a backup before overwriting a file.
set backupcopy=auto 	" When writing a file and a backup is made.  comma separated list of words. - value: yes,no,auto


set nocompatible                " vim, not vi.. must be first, because it changes other options as a side effect
set modeline

set statusline=%M%h%y\ %t\ %F\ %p%%\ %l/%L\ %=[%{&ff},%{&ft}]\ [a=\%03.3b]\ [h=\%02.2B]\ [%l,%v]
set title titlelen=150 titlestring=%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername}

set ttyfast                             " we have a fast terminal
set scrolljump=5          " when scrolling up down, show at least 5 lines

" set tw=500                             " default textwidth is a max of 5

set undolevels=1000             " 50 undos - saved in undodir
set updatecount=250             " switch every 250 chars, save swap

set nowrap

set autoindent smartindent              " auto/smart indent

set autoread                                    " watch for file changes

set backspace=indent,eol,start  " backspace over all kinds of things

set cmdheight=1                                 " command line two lines high
set complete=.,w,b,u,U,t,i,d    " do lots of scanning on tab completion
set cursorline                                  " show the cursor line

set history=3000                                " keep 3000 lines of command line history

set laststatus=2

set linebreak                                   " wrap at 'breakat' instead of last char
set magic                                               " Enable the "magic"

set maxmem=25123        " 24 MB -  max mem in Kbyte to use for one buffer.  Max is 2000000

set noautowrite                                 " don't automagically write on :next

set nospell

set nohidden                                    " close the buffer when I close a tab (I use tabs more than buffers)

set noerrorbells visualbell t_vb= " Disable ALL bells

set number                                      " line numbers

set scrolloff=3                         " keep at least 3 lines above/below
set shiftwidth=3                        " shift width

set showcmd                                     " Show us the command we're typing
set showfulltag                         " show full completion tags
set showmode                            " show the mode all the time

set sidescroll=2                        " if wrap is off, this is fasster for horizontal scrolling
set sidescrolloff=2                     "keep at least 5 lines left/right

set noguipty

set splitright

set splitbelow

set tabpagemax=55
set showtabline=2               " 2 always, 1 only if multiple tabs
set smarttab                    " tab and backspace are smart

set foldmethod=marker
set foldenable
set foldcolumn=3

set showmatch                                   " show matching bracket

set diffopt=filler,iwhite               " ignore all whitespace and sync"
set stal=2

set viewoptions=folds,localoptions,cursor

set spelllang=en