Advertisement
Yunga

vimrc

Jul 26th, 2013
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 5.09 KB | None | 0 0
  1. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  2. "" .vimrc // yunga.palatino@gmail.com
  3.  
  4.  
  5. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  6. """" Global settings
  7. """"
  8.  
  9. set nocompatible                        " no Vi Compatibility
  10. set ttyfast                             " fast terminal connection
  11.  
  12. "" Files Syntax/Plugins
  13. syntax enable
  14. filetype plugin indent on               " file type detection, plugins, indent
  15.  
  16. "" Search/Replace
  17. set nowrapscan                          " no wrap around for search command
  18. set incsearch                           " incremental search
  19. set ignorecase                          " search are case insensitive
  20. set smartcase                           " unless pattern contain uppercase letters
  21. set hlsearch                            " highlight searches
  22. set showmatch                           " show match for corresponding brackets
  23. set gdefault                            " always subsitute all occurence on a line
  24.  
  25. "" Scrolling
  26. set nowrap                              " dont wrap long lines
  27. set scrolljump=8                        " number of lines to scroll at a time
  28. set scrolloff=4                         " number of lines to show around cursor
  29. set sidescrolloff=32                    " number of columns to scroll at a time
  30.  
  31. "" Display
  32. set title                               " try to set xterm title to current file
  33. set titlestring=VIM:\ %F\ %m%h%w%y%r
  34. set titleold=""                         " restore old title on exit
  35.  
  36. set statusline=%<[%02n]\ %F%(\ %m%h%w%y%r%)\ [%{&fo}]\ %a%=\ %8l,%c%V/%L\ (%P)\ [%08O:%02B]
  37. set laststatus=2                        " always keep the status line
  38. set showcmd                             " show command in status line
  39. set cmdheight=2                         " command line height
  40. set shortmess=atToOI                    " Flags for short messages
  41. set report=0                            " Always report changes
  42.  
  43. set wildmode=list:longest,list:full     " enable command completion
  44. set wildmenu                            " display possible completions in menu
  45.  
  46. set number                              " show line numbers
  47. set ruler                               " show cursor position
  48. set cursorline                          " highlight cursor line
  49.  
  50. " Edit
  51. set autoindent                          " keep the same indent for new lines
  52. set smartindent                         " (un)indent in regards to { and }
  53. set history=100                         " number of :cmd to keep in history
  54. set virtualedit=all                     " allow cursor to go anywhere
  55.  
  56. set backspace=indent,eol,start          " backspace and cursor keys wraps to previous/next line
  57. set whichwrap=b,s,<,>,[,]               " backspace, space, left, right wraps to prev/next line
  58.  
  59. set undofile
  60.  
  61. "" Spaces
  62. set noexpandtab                         " don't convert tab to spaces
  63. set tabstop=4                           " tabs are 4 spaces (ts and sw, see 3 in tabstop help)
  64. set shiftwidth=4
  65. set lazyredraw                          " lazy redraw while executing macros
  66.  
  67. "" Mouse
  68. set mouse=a                             " enable mouse in all edit modes
  69. set mousemodel=popup_setpos             " right mouse button show menu
  70.  
  71. "" Files/Buffers
  72. " set fileformat=unix                     " default format to use
  73. set fileformats=unix,dos,mac            " what to look for auto convertion
  74. set encoding=utf-8                      " bye bye ascii
  75. set backup                              " always keep a backup of modified files
  76. set backupext=.bak                      " append .bak to backups filenames
  77. set backupcopy=yes                      " preserve inodes
  78. set hidden                              " dont unload buffers when not in a window
  79.  
  80.  
  81. "" Completion
  82. set wildmode=longest,full               " show the
  83. set wildmenu                            " enhanced command completion
  84. set wildcharm=<C-Z>                     " ctrl-p/n for completion
  85.  
  86.  
  87. colorscheme solarized                   " note: blue/delek/slate/torte in tty
  88.  
  89.  
  90.  
  91. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  92. """" Functions
  93. """"
  94.  
  95.  
  96. """"""""
  97. "" Rotate tabstop value between 2, 4, 8, 16, 32 and 64
  98. "" Mapped to <F2>
  99. ""
  100.  
  101. function My_TabToggle ()              
  102.     let TabStopVal = &tabstop
  103.     let TabStopVal = TabStopVal * 2
  104.  
  105.     if TabStopVal > 64
  106.         let TabStopVal = 2
  107.     endif
  108.    
  109.     let &tabstop = TabStopVal
  110.     echo"TabStop is now: " TabStopVal
  111. endfunction
  112.  
  113.  
  114. """"""""
  115. "" Load the default menu (from the user-manuali/gui.txt)
  116. "" Mapped to <F9>
  117.  
  118. source $VIMRUNTIME/menu.vim
  119.  
  120.  
  121.  
  122. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  123. """" Mappings
  124. """"
  125.  
  126. map <F11> :bprevious<CR>
  127. map <F12> :bnext<CR>
  128.  
  129. map <F2> :call My_TabToggle()<CR>
  130. map <F9> :emenu <C-Z>
  131.  
  132. " relativenumber
  133. " ctrl w
  134.  
  135.  
  136.  
  137. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  138. """" AutoCommands
  139. """"
  140.  
  141. "" always jump to the last known cursor position if it is valid
  142. autocmd BufReadPost *
  143.     \ if line("'\"") > 0 && line("'\"") <= line("$") |
  144.     \   exe "normal g`\"" |
  145.     \ endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement