Guest User

Untitled

a guest
Jul 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.68 KB | None | 0 0
  1. ## .gvimrc
  2.  
  3. set ch=2 " Make command line two lines high
  4.  
  5. set imd
  6.  
  7. set mousehide " Hide the mouse when typing text
  8.  
  9. set go-=T " Hide top toolbar on start
  10.  
  11. " Make shift-insert work like in Xterm
  12. map <S-Insert> <MiddleMouse>
  13. map! <S-Insert> <MiddleMouse>
  14.  
  15. " Only do this for Vim version 5.0 and later.
  16. if version >= 500
  17.  
  18. " I like highlighting strings inside C comments
  19. let c_comment_strings=1
  20.  
  21. " Switch on syntax highlighting if it wasn't on yet.
  22. if !exists("syntax_on")
  23. syntax on
  24. endif
  25.  
  26. " Switch on search pattern highlighting.
  27. set hlsearch
  28.  
  29. endif
  30.  
  31. if has("gui_macvim")
  32. set transp=5
  33. set cursorline
  34. set guioptions-=T
  35. set guioptions-=r
  36. set guioptions-=l
  37. set guioptions-=L
  38. set guioptions-=R
  39. set guifont=Droid\ Sans\ Mono:h12.00
  40. endif
  41.  
  42. ## .vimrc
  43. " When started as "evim", evim.vim will already have done these settings.
  44. if v:progname =~? "evim"
  45. finish
  46. endif
  47.  
  48. " Use Vim settings, rather then Vi settings (much better!).
  49. " This must be first, because it changes other options as a side effect.
  50. set nocompatible
  51.  
  52. " allow backspacing over everything in insert mode
  53. set backspace=indent,eol,start
  54.  
  55. if has("vms")
  56. set nobackup " do not keep a backup file, use versions instead
  57. else
  58. set backup " keep a backup file
  59. endif
  60. set history=500 " keep 50 lines of command line history
  61. set ruler " show the cursor position all the time
  62. set showcmd " display incomplete commands
  63. set incsearch " do incremental searching
  64.  
  65. " Don't use Ex mode, use Q for formatting
  66. map Q gq
  67.  
  68. " Switch syntax highlighting on, when the terminal has colors
  69. " Also switch on highlighting the last used search pattern.
  70. if &t_Co > 2 || has("gui_running")
  71. syntax on
  72. set hlsearch
  73. endif
  74.  
  75. " Only do this part when compiled with support for autocommands.
  76. if has("autocmd")
  77.  
  78. " Enable file type detection.
  79. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  80. " 'cindent' is on in C files, etc.
  81. " Also load indent files, to automatically do language-dependent indenting.
  82. filetype plugin indent on
  83.  
  84. " Put these in an autocmd group, so that we can delete them easily.
  85. augroup vimrcEx
  86. au!
  87.  
  88. " For all text files set 'textwidth' to 78 characters.
  89. autocmd FileType text setlocal textwidth=80
  90.  
  91. " When editing a file, always jump to the last known cursor position.
  92. " Don't do it when the position is invalid or when inside an event handler
  93. " (happens when dropping a file on gvim).
  94. autocmd BufReadPost *
  95. \ if line("'\"") > 0 && line("'\"") <= line("$") |
  96. \ exe "normal g`\"" |
  97. \ endif
  98.  
  99. augroup END
  100.  
  101. else
  102.  
  103. set autoindent " always set autoindenting on
  104.  
  105. endif " has("autocmd")
  106.  
  107. " settings for MiniBufExplorer
  108. let g:miniBufExplMapWindowNavVim = 1
  109. let g:miniBufExplMapWindowNavArrows = 1
  110. let g:miniBufExplCTabSwitchBufs = 1
  111. let g:miniBufExplSelTarget = 1
  112.  
  113. set co=80
  114. set nu
  115. set gfn=Anonymous\ Pro:h12
  116. set sta
  117.  
  118. " From SA Users
  119. set listchars=tab:»·,trail:·
  120. set list
  121.  
  122. " Colorization/display
  123. " syntax highlighting!
  124. syntax on
  125. colorscheme lanai
  126. set background=dark
  127. set ruler
  128. set showcmd
  129. set laststatus=2
  130. "set statusline=%{GitBranchInfoString()}
  131. set statusline=%1*%F%m%r%h%w%=%(%c%V\ %l/%L\ %P%)\ %{GitBranchInfoString()}
  132.  
  133. " navigation/search
  134. set showmatch
  135. set matchtime=2
  136. set incsearch
  137. set ignorecase
  138. set smartcase
  139. set nohls
  140.  
  141. " formatting
  142. set autoindent
  143. set preserveindent
  144. set nosmartindent
  145. set smarttab
  146. set expandtab
  147. set textwidth=80
  148. set tabstop=4
  149. set softtabstop=4
  150. set shiftwidth=4
  151. set formatoptions=tcroqn2
  152. set lbr
  153.  
  154. " Behavior
  155. set foldmethod=indent
  156. set nofoldenable
  157. set shellcmdflag=-c
  158. set shell=bash\ -l
  159. set modeline
  160. set modelines=5
  161. set splitright
  162. set scrolloff=3
  163. set nomore
  164. set wildmenu
  165. set wildmode=list:longest
  166. set tabpagemax=100
  167. set switchbuf=usetab
  168.  
  169. filetype plugin on
  170.  
  171. " Don't back up files to current directory, use a common spot
  172. silent execute '!mkdir -p ~/.vim_backups'
  173. set backupdir=~/.vim_backups//
  174. set directory=~/.vim_backups//
  175.  
  176. " Jump to last known location in file
  177. if has("autocmd")
  178. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  179. \| exe "normal g'\"" | endif
  180. endif
  181.  
  182. " Filetype based indent rules
  183. if has("autocmd")
  184. filetype indent plugin on
  185. endif
  186.  
  187.  
  188. "
  189. " netrw (builtin file-browser plugin) preferences
  190. "
  191.  
  192. " Default to tree view
  193. let g:netrw_lifestyle = 3
  194. " hide common hidden files
  195. let g:netrw_list_hide = '.*\.py[co]$,\.git$,\.swp$'
  196. " Don't use fricken elinks, wtf
  197. let g:netrw_http_cmd = "wget -q -O" " or 'curl -Ls -o'
  198.  
  199. " Git helper: take up to full length SHA1 under cursor and truncate to 7
  200.  
  201. function! TruncateToSevenChars()
  202. " use viwo instead of b so it works even when cursor is on 1st char of word
  203. return "viwo7ld"
  204. endf
  205.  
  206. function! FormatShaForCommit()
  207. return TruncateToSevenChars() . "bicommit:\<Esc>w"
  208. endf
  209.  
  210. nnoremap <expr> <F7> FormatShaForCommit()
  211.  
  212. set imd
  213.  
  214. " Window settings
  215. set winminheight=0
  216. set wmw=0
  217. set winheight=999
  218.  
  219. " Folds
  220. nnoremap <silent> <Space> @=(foldlevel('.')?'za':'l')<CR>
  221. vnoremap <Space> zf
  222.  
  223. " Searching
  224. nmap n nzzzv
  225. nmap N Nzzzv
  226. nmap * *zzzv
  227. nmap # #zzzv
  228. nmap g* g*zzzv
  229. nmap g# g#zzzv
  230.  
  231. " Save sessions
  232. set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos
  233. autocmd FileType python set omnifunc=pythoncomplete#Complete
  234. autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
  235. autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
  236. autocmd FileType css set omnifunc=csscomplete#CompleteCSS
  237.  
  238. let Tlist_Use_Right_Window=1
  239. let Tlist_Auto_Open=0
  240. let Tlist_Enable_Fold_Column=0
  241. let Tlist_Compact_Format=0
  242. let Tlist_WinWidth=70
  243. let Tlist_Exit_OnlyWindow=1
  244. let Tlist_File_Fold_Auto_Close = 1
Add Comment
Please, Sign In to add comment