Advertisement
atimholt

My vimrc 2012-01-18

Jan 18th, 2012
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 30.12 KB | None | 0 0
  1. " Tim Holt's vimrc file
  2. " Created probably in 2010, Idunno.
  3. "   modified extensively continuously since then.
  4. "
  5. " This file is full of ‘*’ command ‘links’ __in_this_format.
  6. "
  7. " Free to use for anyone
  8.  
  9. "│-v-1 │ To-Do's  
  10. "└─────┴─────────
  11.   " (not actually settings, just settings todo's)
  12.   " TODO Look into the 'tabline' setting
  13.   " TODO When numbers are off, change window width.
  14.   "
  15.   " TODO Use winnr("$"), winnr(), winfixwidth to create a better resize
  16.     " This may be obsolete, but I don’t think it is—it’s still necessary when
  17.     " not on a wide screen.
  18.   " TODO Make “i_Ctrl-R ,” put the “+” yank buffer’s contents.
  19.   "
  20.   " TODO mappings that “Hesitate”:
  21.     " <leader>i
  22.     " <leader>w
  23.   " TODO Look into the conceal setting and this reddit thread:
  24.   "   http://redd.it/okzja
  25.   " TODO Set up some cool Arpeggio mappings.
  26.  
  27. "│-v-1 │ “precedence” necessaries.
  28. "└─────┴───────────────────────────
  29.   "For virtually everything, and sanity in general:
  30.   set nocp
  31.   filetype plugin on
  32.  
  33.   "For that which __requires_utf_8:
  34.   set encoding=utf8
  35.  
  36.   " Note: Make sure to link here from _every_ line that has a prerequisite,
  37.   " and from every location in this file where the prerequisite would more
  38.   " naturally be categorized.
  39.  
  40.  
  41. "│-v-1 │ Plug-in Settings
  42. "└─┬───┴─┬────────────────
  43.   "│-v-2 │ plug-in manager
  44.   "└─────┴─────────────────
  45.     " pathogen startup stuff
  46.       filetype off
  47.       call pathogen#infect()
  48.       call pathogen#helptags()
  49.       filetype plugin on
  50.  
  51.  
  52.   "│-v-2 │ Individual plug-ins
  53.   "└─┬───┴─┬───────────────────
  54.     "│-v-3 │ Gundo Settings
  55.     "└─────┴────────────────
  56.       nnoremap <silent> <leader>u :GundoToggle<cr>
  57.       let g:gundo_help=1
  58.       let g:gundo_right=0
  59.       let g:gundo_preview_bottom=0
  60.  
  61.       " Mappings (@__gundo_mappings):
  62.         " toggle Gundo
  63.  
  64.     "│-v-3 │ vimwiki Settings
  65.     "└─────┴──────────────────
  66.       let g:vimwiki_camel_case = 0
  67.  
  68.       let wiki_1 = {}
  69.       let wiki_1.path = '~/Dropbox/Vim/vimwiki/'
  70.       let wiki_1.nested_syntaxes = {'c++': 'cpp', 'asm': 'asm', 'sh': 'sh'}
  71.  
  72.       let wiki_2 = {}
  73.       let wiki_2.path = '~/Dropbox/timwrite/vimfriendly/Inhuman_Universe/wiki/'
  74.  
  75.       let wiki_3 = {}
  76.       let wiki_3.path = '~/Dropbox/code/ZigZagDungeon/productionwiki/'
  77.  
  78.       let g:vimwiki_list = [wiki_1, wiki_2, wiki_3]
  79.  
  80.     "│-v-3 │ Full-Screen Mode Settings
  81.     "└─────┴───────────────────────────
  82.       " Mappings (@__full_screen_mappings):
  83.       function! ToggleFullScreen()
  84.         if has('win32')
  85.           :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
  86.         endif
  87.       endfunction
  88.  
  89.     "│-v-3 │ 'a' settings
  90.     "└─────┴──────────────
  91.       " Mappings (@__a_mappings):
  92.  
  93.       "Hopefully, changing the default when associated source doesn't yet exist.
  94.       let g:alternateExtensions_h = "cpp,c,cxx,cc,CC"
  95.  
  96.     "│-v-3 │ OmniCppComplete Settings
  97.     "└─────┴──────────────────────────
  98.       au BufNewFile,BufRead,BufEnter *.cpp,*.h set omnifunc=omni#cpp#complete#Main
  99.       let OmniCpp_ShowPrototypeInAbbr = 1
  100.  
  101.     "│-v-3 │ PowerShell syntaxy-stuff settings
  102.     "└─────┴───────────────────────────────────
  103.       au BufNewFile,BufRead,BufEnter *.ps1 set filetype=ps1
  104.  
  105.     "│-v-3 │ Rainbow Parentheses Settings
  106.     "└─────┴──────────────────────────────
  107.       " (Steve Losh’s modified version, cleaned up and jazz)
  108.  
  109.       " Mappings (@__rainbow_parentheses_mappings):
  110.       autocmd BufEnter * RainbowParenthesesLoadRound
  111.       autocmd BufEnter * RainbowParenthesesLoadBraces
  112.  
  113.     "│-v-3 │ Powerline Settings
  114.     "└─────┴────────────────────
  115.       let Powerline_cache_file = ""
  116.       let Powerline_symbols = "fancy"
  117.  
  118.     "│-v-3 │ UltiSnips Settings
  119.     "└─────┴────────────────────
  120.       let g:UltiSnipsSnippetsDir = "~/Dropbox/Vim/GlobalRuntimePath/UltiSnipsSnippets/"
  121.       let g:UltiSnipsSnippetDirectories=["UltiSnips", "UltiSnipsSnippets"]
  122.       let g:UltiSnipsEditSplit = "horizontal"
  123.  
  124.       "let g:UltiSnipsExpandTrigger="<tab>"
  125.  
  126. "│-v-1 │ Set-up
  127. "└─┬───┴─┬──────
  128.   "│-v-2 │ Behavior
  129.   "└─┬───┴─┬────────
  130.     "│-v-3 │ “meta” (settings settings)
  131.     "└─────┴────────────────────────────
  132.  
  133.       " Quick settings access
  134.         " TODO: Move the function to function area, remap to remap area?
  135.         "         Honestly, I think not—an exception makes sense here, at least.
  136.         function! MyQuickSettings()
  137.           :tabedit $MYVIMRC
  138.           :lcd $HOME
  139.           :vs ~/Dropbox/Vim/vimrc.vim
  140.           :vertical resize 101
  141.         endfunction
  142.  
  143.         nnoremap <silent> <F2> :call MyQuickSettings()<cr>
  144.  
  145.  
  146.       " Reload vimrc when saved
  147.         au! BufWritePost $MYVIMRC source $MYVIMRC
  148.  
  149.         " Doesn’t work, because MyRefreshFullScreen doesn’t work.
  150.         " TODO: evaluate this thing.
  151.         function! MyRefreshVimrc()
  152.           :source $MYVIMRC
  153.           :call MyRefreshFullScreen()
  154.         endfunction
  155.  
  156.     "│-v-3 │ Tweakings/Feature Settings
  157.     "└─┬───┴─┬──────────────────────────
  158.       "│-v-4 │ Intended/Built-In Settings
  159.       "└─┬───┴─┬──────────────────────────
  160.         "│-v-5 │ Editing Settings
  161.         "└─────┴──────────────────
  162.           set expandtab
  163.           set shiftwidth=2
  164.           set softtabstop=2
  165.           set tabstop=2
  166.           set backspace=indent,eol,start
  167.           set ruler
  168.           :syntax enable
  169.           :set cindent
  170.  
  171.           " Stopped using this when I started using Powershell more.
  172.           ":set shellslash
  173.  
  174.           :set switchbuf=useopen,usetab,newtab
  175.  
  176.           " Allows the closing of buffers without saving.
  177.           set hidden
  178.  
  179.           " allows cursor position past true end of line
  180.           set virtualedit=all
  181.  
  182.           " Whether jumping to another line (like with "G") goes to the start
  183.           " of the line, or tries to stay in the same column.
  184.           set nostartofline
  185.  
  186.         "│-v-5 │ vimdiff settings
  187.         "└─────┴──────────────────
  188.           set diffopt=filler,vertical,context:3
  189.  
  190.         "│-v-5 │ Spelling
  191.         "└─────┴──────────
  192.           set spelllang=en_us,es,eo
  193.  
  194.         "│-v-5 │ Status Line
  195.         "└─────┴─────────────
  196.           ":set statusline=%F%m%r%h%w\ (%{&ff})\ typ:%Y\ ASCII=\%04.8b\ HEX=\%04.4B\ %l,%v %p%%\ LEN=%L
  197.           "set statusline=%<[%02n]\ %F%(\ %m%h%w%y%r%)\ %a%=\ %8l,%c%V/%L\ (%P)\ [%08O:%02B]
  198.           set statusline=%<[%02n]\ %F%(\ %m%h%w%y%r%)\ %a%=\ %8l,%c%V/%L\ (%P)\ [%02B]
  199.  
  200.           set laststatus=2
  201.             " “The value of this option influences when the
  202.             " last window will have a status line…”
  203.  
  204.         "│-v-5 │ Folds
  205.         "└─────┴──────────
  206.           :set foldmethod=marker
  207.           :set foldmarker=-v-,-^-
  208.           :set commentstring=//%s
  209.  
  210.         "│-v-5 │ WildMenu
  211.         "└─────┴──────────
  212.           set wildmode=longest,list,full
  213.           :set wildmenu
  214.  
  215.         "│-v-5 │ persistent undo
  216.         "└─────┴─────────────────
  217.           set undofile
  218.  
  219.         "│-v-5 │ search settings
  220.         "└─────┴─────────────────
  221.           set ignorecase
  222.           set smartcase
  223.           set gdefault
  224.           set incsearch
  225.           set showmatch
  226.           set hlsearch
  227.           " Mappings (@__search_mappings):
  228.           " - Switch off search highlighting.
  229.  
  230.         "│-v-5 │ netrw settings
  231.         "└─────┴────────────────
  232.           let g:netrw_liststyle=3
  233.  
  234.         "│-v-5 │ External Shell Settings
  235.         "└─────┴─────────────────────────
  236.           " __requires_utf_8:
  237.           if has('win32')
  238.             set shell=powershell.exe
  239.             set shellcmdflag=-c
  240.             set shellpipe=|
  241.             set shellredir=>
  242.           endif
  243.  
  244.         "│-v-5 │ mkview settings
  245.         "└─────┴─────────────────
  246.           set viewdir=~/Dropbox/Vim/GlobalRuntimePath/view/
  247.  
  248.       "│-v-4 │ Customized behavior
  249.       "└─┬───┴─┬───────────────────
  250.         "│-v-5 │ (function) Toggle Spell Checking.
  251.         "└─────┴───────────────────────────────────
  252.           " (mapping @__spell_check_mapping)
  253.           function! g:ToggleSpellMode()
  254.             :set spell!
  255.             if &l:spell
  256.               echo "Spell check ON"
  257.             else
  258.               echo "Spell check OFF"
  259.             endif
  260.           endfunction
  261.  
  262.         "│-v-5 │ (function) Toggle Fixed Window Width.
  263.         "└─────┴───────────────────────────────────────
  264.           " (mapping @__fixed_window_width)
  265.  
  266.           function! g:TimToggleWindowFixedWidth()
  267.             :set winfixwidth!
  268.             if &l:winfixwidth
  269.               echo "Fixed Window Width ON"
  270.             else
  271.               echo "Fixed Window Width OFF"
  272.             endif
  273.           endfunction
  274.  
  275.         "│-v-5 │ (function) Box character (turburul) hax
  276.         "└─────┴─────────────────────────────────────────
  277.           " This:
  278.           " r---—v-,
  279.           " |    | |
  280.           " >----+-<
  281.           " |    | |
  282.           " >————+—<
  283.           " |    | |
  284.           " L----^—’
  285.           "
  286.           " Becomes This:
  287.           " ┌────┬─┐
  288.           " │    │ │
  289.           " ├────┼─┤
  290.           " │    │ │
  291.           " ├────┼─┤
  292.           " │    │ │
  293.           " └────┴─┘
  294.         " (mapping @__box_characters_mapping)
  295.           function! g:BoxCharacters()
  296.             :s'r''e
  297.            gv
  298.            :s','┐'e
  299.             gv
  300.             :s'’''e
  301.            gv
  302.            :s/'//e
  303.             gv
  304.             :s'L''e
  305.  
  306.            gv
  307.            :s'|'│'e
  308.             gv
  309.             :s'-''e
  310.            gv
  311.            :s''─'e
  312.             gv
  313.             :s'+''e
  314.  
  315.            gv
  316.            :s'\^'┴'e
  317.             gv
  318.             :s'>''e
  319.            gv
  320.            :s'v'┬'e
  321.             gv
  322.             :s'T''e
  323.            gv
  324.            :s'<'┤'e
  325.           endfunction
  326.  
  327.         "│-v-5 │ (functions) Multi-Window automatic stuff
  328.         "└─────┴──────────────────────────────────────────
  329.           " These settings rely heavily on the specific ways I personally use Vim.
  330.           " (auto-commands @__multi_window_autocmds)
  331.  
  332.           function! TimWinLeaveWithGundo()
  333.             if !GundoInTab() && g:timdisplaymode == 'code'
  334.               ":vertical resize
  335.               :set nowrap
  336.               ":set norelativenumber
  337.               ":set nonumber
  338.             endif
  339.           endfunction
  340.  
  341.           function! TimWinEnterWithGundo()
  342.             if !GundoInTab() && g:timdisplaymode == 'code'
  343.               if g:tim_number_mode == 0
  344.                 ":vertical resize 81
  345.               else
  346.                 ":vertical resize 85
  347.               endif
  348.               :set wrap
  349.               :call g:TimDisplayNumbers()
  350.             endif
  351.           endfunction
  352.  
  353.           function! GundoInTab()
  354.             let s:current_tabpagebuflist = tabpagebuflist()
  355.             for i in s:current_tabpagebuflist
  356.               if bufname(i) == "__Gundo__"
  357.                 return 1
  358.               endif
  359.             endfor
  360.             return 0
  361.           endfunction
  362.  
  363.         "│-v-5 │ (functions) Line-number Mode switching
  364.         "└─────┴────────────────────────────────────────
  365.           " (mappings @__line_number_modes_mappings)
  366.  
  367.           let g:tim_number_mode = 1
  368.  
  369.           function! g:ToggleNuMode(...)
  370.             if a:0
  371.               if(a:1 != -1)
  372.                 let g:tim_number_mode = a:1
  373.               else
  374.                 let g:tim_number_mode -= 1
  375.               endif
  376.             else
  377.               let g:tim_number_mode += 1
  378.             endif
  379.  
  380.             if g:tim_number_mode > 2
  381.               let g:tim_number_mode = 0
  382.             endif
  383.             if g:tim_number_mode < 0
  384.               let g:tim_number_mode = 2
  385.             endif
  386.  
  387.             call g:TimDisplayNumbers()
  388.           endfunc
  389.  
  390.           function! g:TimDisplayNumbers()
  391.             if(g:tim_number_mode == 1)
  392.               if g:timdisplaymode == 'code'
  393.                 ":vertical resize 85
  394.               endif
  395.               set number
  396.             elseif(g:tim_number_mode == 2)
  397.               if g:timdisplaymode == 'code'
  398.                 ":vertical resize 85
  399.               endif
  400.               set relativenumber
  401.             else
  402.               if g:timdisplaymode == 'code'
  403.                 ":vertical resize 81
  404.               endif
  405.               set nonumber
  406.               set norelativenumber
  407.             endif
  408.           endfunc
  409.  
  410.         "│-v-5 │ (functions) View and Folds saving
  411.         "└─────┴───────────────────────────────────
  412.           " (mappings @__viewdir_mappings)
  413.           " TODO: for realsy, this needs to be its own script in the
  414.           " repository
  415.           " TODO: echo the current mode on toggle
  416.           " TODO: loadview automatically in zigzagproj mode on file loading
  417.  
  418.           function! g:toggleviewdir()
  419.             if g:viewdirmode == "normal"
  420.               let g:viewdirmode = "zigzagproj"
  421.             else
  422.               let g:viewdirmode = "normal"
  423.             endif
  424.  
  425.             call g:applyviewdir()
  426.           endfunction
  427.          
  428.           function! g:applyviewdir()
  429.             if g:viewdirmode == "normal"
  430.               set viewdir=~/Dropbox/Vim/GlobalRuntimePath/view/
  431.             else
  432.               set viewdir=~/Dropbox/code/ZigZagDungeon/vimview/
  433.             endif
  434.             "echo "
  435.           endfunction
  436.  
  437.           let g:viewdirmode = "normal"
  438.           call g:applyviewdir()
  439.  
  440.         "│-v-5 │ (functions) Indenting a fold comment line
  441.         "└─────┴───────────────────────────────────────────
  442.           " (mappings @__fold_indent)
  443.           " TODO: provide exceptions for certain file types.
  444.  
  445.           " For properly 'right justifying' fold lines.
  446.         " function! g:justify_fold(...)
  447.         "   " TODO: Make these customizable
  448.         "   let myfoldwidth = 2
  449.         "   let myfoldrightmost = 80
  450.         "
  451.         "   let myfolddepth = 1
  452.         "   ifa:0
  453.         "     let myfolddepth = a:1
  454.         "   endif
  455.         "
  456.         "   $
  457.         "
  458.         "  
  459.         " endfunction
  460.  
  461.     "│-v-3 │ Mappings, Auto-Commands & Abbreviations.
  462.     "└─┬───┴─┬────────────────────────────────────────
  463.       "│-v-4 │ Mappings
  464.       "└─┬───┴─┬────────
  465.         "│-v-5 │ Leader Key Settings
  466.         "└─────┴─────────────────────
  467.           let mapleader = ","
  468.                 " doesn't work?:
  469.           noremap <C-,> <leader>
  470.  
  471.           " Still want this functionality!
  472.           map \u <Nop>
  473.           nnoremap \ ,
  474.  
  475.         "│-v-5 │ navigation remaps
  476.         "└─────┴─────────────────────
  477.           "nnoremap <tab> %
  478.           "vnoremap <tab> %
  479.  
  480.           nnoremap <silent> <leader>t :tabs<cr>
  481.  
  482.           nnoremap j gj
  483.           nnoremap k gk
  484.           nnoremap gj j
  485.           nnoremap gk k
  486.  
  487.           nnoremap <leader>h <C-W>h
  488.           nnoremap <leader>l <C-W>l
  489.           nnoremap <leader>j <C-W>j
  490.           nnoremap <leader>k <C-W>k
  491.  
  492.         "│-v-5 │ Normal-Mode alternative access.
  493.         "└─────┴─────────────────────────────────
  494.           " TODO: Change the windows mapping to changing caps lock to esc.
  495.           if has('win32')
  496.             inoremap hh <esc>
  497.             cnoremap hh <esc>
  498.           endif
  499. "         Arpeggio inoremap tn <esc>
  500. "         Arpeggio cnoremap tn <esc>
  501.  
  502.         "│-v-5 │ toggle showing of invisible characters
  503.         "└─────┴────────────────────────────────────────
  504.           nnoremap <silent> <leader>i :set list!<cr>
  505.  
  506.         "│-v-5 │ OS clip-board easy-integration.
  507.         "└─────┴─────────────────────────────────
  508.           nnoremap <leader>y "+y
  509.           vnoremap <leader>y "+y
  510.  
  511.           nnoremap <leader>Y "+Y
  512.           vnoremap <leader>Y "+Y
  513.  
  514.           nnoremap <leader>p "+p
  515.           vnoremap <leader>p "+p
  516.  
  517.           nnoremap <leader>P "+P
  518.           vnoremap <leader>P "+P
  519.  
  520.         "│-v-5 │ Jump to file shortcut
  521.         "└─────┴───────────────────────
  522.           nnoremap <silent> <leader>f <c-w>gf
  523.  
  524.         "│-v-5 │ File-name completion shortcut
  525.         "└─────┴───────────────────────────────
  526.           inoremap <c-f> <c-x><c-f>
  527.  
  528.         "│-v-5 │ __search_mappings:
  529.         "└─────┴────────────────────
  530.           " Switch off search highlighting.
  531.           nnoremap <silent> <leader><space> :noh<cr>
  532.  
  533.         "│-v-5 │ Quick window-width reset
  534.         "└─────┴──────────────────────────
  535.           nnoremap <leader><Bar>    :vertical resize 85<cr>
  536.           nnoremap <leader><Bslash> :vertical resize 85<cr>
  537.  
  538.         "│-v-5 │ Generate Tag files
  539.         "└─────┴────────────────────
  540.           "map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
  541.           "map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q *.h *.cpp<CR>
  542.           map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ .<CR>
  543.  
  544.         "│-v-5 │ Arpeggio shortcuts experiment
  545.         "└─────┴───────────────────────────────
  546. "         Arpeggio noremap s, /
  547. "         Arpeggio noremap s. \
  548.  
  549.         "│-v-5 │ mappings to customized-behavior & functions.
  550.         "└─┬───┴─┬────────────────────────────────────────────
  551.           "│-v-6 │ __spell_check_mapping:
  552.           "└─────┴────────────────────────
  553.             nnoremap <F5> :call g:ToggleSpellMode()<cr>
  554.  
  555.           "│-v-6 │ __fixed_window_width:
  556.           "└─────┴───────────────────────
  557.             nnoremap <leader>W :call g:TimToggleWindowFixedWidth()<cr>
  558.  
  559.           "│-v-6 │ __box_characters_mapping:
  560.           "└─────┴───────────────────────────
  561.             vnoremap <silent> <leader>x :call g:BoxCharacters()<cr>
  562.  
  563.           "│-v-6 │ __line_number_modes_mappings:
  564.           "└─────┴───────────────────────────────
  565.             nnoremap <silent> <leader>n :call g:ToggleNuMode()<cr>
  566.  
  567.             nnoremap <silent> <leader>NN :call g:ToggleNuMode(-1)<cr>
  568.  
  569.  
  570.             nnoremap <silent> <leader>N0 :call g:ToggleNuMode(0)<cr>
  571.             nnoremap <silent> <leader>No :call g:ToggleNuMode(0)<cr>
  572.             nnoremap <silent> <leader>NO :call g:ToggleNuMode(0)<cr>
  573.  
  574.             nnoremap <silent> <leader>Na :call g:ToggleNuMode(1)<cr>
  575.             nnoremap <silent> <leader>NA :call g:ToggleNuMode(1)<cr>
  576.  
  577.             nnoremap <silent> <leader>Nr :call g:ToggleNuMode(2)<cr>
  578.             nnoremap <silent> <leader>NR :call g:ToggleNuMode(2)<cr>
  579.  
  580.           "│-v-6 │ __display_mode_mappings:
  581.           "└─────┴──────────────────────────
  582.             nnoremap <silent> <leader>d :call ToggleDisplayMode()<cr>
  583.  
  584.           "│-v-6 │ __viewdir_mappings:
  585.           "└─────┴─────────────────────
  586.             nnoremap <silent> <f6> :call g:toggleviewdir()<cr>
  587.  
  588.           "│-v-6 │ Insert literal tab character
  589.           "└─────┴──────────────────────────────
  590.             inoremap <silent> <s-tab> <c-v><tab>
  591.  
  592.           "│-v-6 │ Insert date:
  593.           "└─────┴──────────────
  594.             nmap <F3> a<C-R>=strftime("%Y-%m-%d")<CR><Esc>
  595.             imap <F3> <C-R>=strftime("%Y-%m-%d")<CR>
  596.             vmap <F3> di<C-R>=strftime("%Y-%m-%d")<CR><Esc>
  597.  
  598.             nmap <S-F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
  599.             imap <S-F3> <C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR>
  600.             vmap <S-F3> di<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
  601.  
  602.  
  603.         "│-v-5 │ mappings to Plug-ins
  604.         "└─┬───┴─┬────────────────────
  605.           "│-v-6 │ __gundo_mappings:
  606.           "└─────┴───────────────────
  607.             " toggle Gundo:
  608.             nnoremap <silent> <leader>u :GundoToggle<cr>
  609.  
  610.           "│-v-6 │ __full_screen_mappings:
  611.           "└─────┴─────────────────────────
  612.             map <silent> <F11> <Esc>:call ToggleFullScreen()<CR>
  613.  
  614.           "│-v-6 │ __a_mappings:
  615.           "└─────┴───────────────
  616.             nnoremap <silent> <leader>a :AV<cr>
  617.             nnoremap <silent> <leader>s :AV<cr>
  618.  
  619.             " TODO: move this somewhere more sensible:
  620.             nnoremap <silent> <leader>v :vs<cr>
  621.  
  622.           "│-v-6 │ __rainbow_parentheses_mappings:
  623.           "└─────┴─────────────────────────────────
  624.             nnoremap <silent> <leader>, :RainbowParenthesesToggle<cr>
  625.  
  626.       "│-v-4 │ Auto-commands
  627.       "└─┬───┴─┬─────────────
  628.         "│-v-5 │ Independent auto-commands
  629.         "└─────┴───────────────────────────
  630.           autocmd BufRead,BufNewFile *.txtfmt setfiletype txtfmt
  631.         "│-v-5 │ function auto-commands
  632.         "└─┬───┴─┬──────────────────────
  633.           "│-v-6 │ __multi_window_autocmds
  634.           "└─────┴─────────────────────────
  635.             autocmd WinLeave * :call TimWinLeaveWithGundo()
  636.             autocmd WinEnter * :call TimWinEnterWithGundo()
  637.  
  638.  
  639.       "│-v-4 │ Abbreviations
  640.       "└─┬───┴─┬─────────────
  641.         "│-v-5 │ Shortcuts
  642.         "└─────┴───────────
  643.           ab ?!
  644.           ab !?
  645.  
  646.           :ab ,.0 ⁰
  647.           :ab ,.1 ¹
  648.           :ab ,.2 ²
  649.           :ab ,.3 ³
  650.           :ab ,.4 ⁴
  651.           :ab ,.5 ⁵
  652.           :ab ,.6 ⁶
  653.           :ab ,.7 ⁷
  654.           :ab ,.8 ⁸
  655.           :ab ,.9 ⁹
  656.  
  657.         "│-v-5 │ Corrections
  658.         "└─────┴─────────────
  659.           :cab Wa wa
  660.  
  661.   "│-v-2 │ Appearance
  662.   "└─┬───┴─┬──────────
  663.     "│-v-3 │ Built-in Settings
  664.     "└─┬───┴─┬─────────────────
  665.       "│-v-4 │ GUI Options (default is "egmrLtT")
  666.       "└─────┴────────────────────────────────────
  667.         :set guioptions=c
  668.         " Note that fullscreen plugin doesn't work well with anything but null
  669.         " (or similar).
  670.  
  671.       "│-v-4 │ Color scheme
  672.       "└─────┴──────────────
  673.         set t_Co=256
  674.  
  675.         " Not sure if this one's actually necessary.
  676.         :set background=dark
  677.  
  678.         if &t_Co > 2 || has("gui_running")
  679.           :colorscheme timbat
  680.           ":colorscheme timatrix " I've put a lot of my own adjustments into this one.
  681.          ":colorscheme pyte
  682.        else
  683.          :colorscheme morodark
  684.        endif
  685.  
  686.      "│-v-4 │ Current-Row-Column highlighting
  687.      "└─────┴─────────────────────────────────
  688.        "autocmd WinLeave * set nocursorline nocursorcolumn
  689.        "autocmd WinEnter * set cursorline cursorcolumn
  690.        "set cursorline cursorcolumn
  691.  
  692.        autocmd WinLeave * set nocursorline
  693.        autocmd WinEnter * set cursorline
  694.        set cursorline
  695.  
  696.      "│-v-4 │ Window Width & Such
  697.      "└─────┴─────────────────────
  698.        set winminwidth=5
  699.  
  700.      "│-v-4 │ Invisible characters depiction.
  701.      "└─────┴─────────────────────────────────
  702.        " __requires_utf_8:
  703.        set listchars=tab:│·,trail:·,extends:→
  704.  
  705.        au BufNewFile,BufRead *.cpp,*.h,*.vim,*.rb,*.java,*.snippets,*.py set list
  706.  
  707.      "│-v-4 │ Miscellaneous
  708.      "└─────┴───────────────
  709.        set showcmd
  710.  
  711.      "│-v-4 │ Color Column
  712.      "└─────┴──────────────
  713.        set colorcolumn=81,101,121
  714.  
  715.    "│-v-3 │ Custom Functions
  716.    "└─┬───┴─┬────────────────
  717.      "│-v-4 │ Display Mode Stuff
  718.      "└─────┴────────────────────
  719.        " Mappings (@__display_mode_mappings):
  720.        function! g:ApplyDisplayMode(...)
  721.          if a:0
  722.            let g:timdisplaymode = a:1
  723.          endif
  724.  
  725.          if g:timdisplaymode == 'code'
  726.            "set cursorcolumn
  727.            set nospell                                    " -v-
  728.  
  729.            if &filetype=='vimwiki'
  730.              setlocal linebreak
  731.            else
  732.              set nolinebreak
  733.            endif
  734.  
  735.            if has('win32')
  736.              " :set guifont=consolas:h12
  737.              set guifont=Liberation\ Mono:h11
  738.            else
  739.              set guifont=Liberation\ Mono\ 11
  740.            endif
  741.  
  742.            colorscheme timbat
  743.            set display-=lastline
  744.            let &showbreak = ''
  745.            set foldmarker=-v-,-^-
  746.            "au WinEnter * set cursorcolumn
  747.                                                           " -^-
  748.          elseif g:timdisplaymode == 'composition'
  749.            set nocursorcolumn
  750.            setlocal spell                                 " -v-
  751.            inoremap <C-BS> <Esc>b1z=wi
  752.  
  753.            setlocal linebreak
  754.  
  755.            if has('win32')
  756.              set guifont=Liberation\ Mono:h16
  757.            else
  758.              set guifont=Liberation\ Mono\ 16
  759.            endif
  760.  
  761.            colorscheme timatrix
  762.            setlocal display+=lastline
  763.            let &showbreak = '  '
  764.            " setlocal foldmarker={{{,}}}
  765.            set foldmarker=-v-,-^-
  766.            au BufEnter * set nocursorcolumn
  767.          endif                                            " -^-
  768.        endfunction
  769.  
  770.        let g:timdisplaymode = ''
  771.        call g:ApplyDisplayMode('code')
  772.  
  773.        function! ToggleDisplayMode()
  774.          if g:timdisplaymode == 'code'
  775.            let g:timdisplaymode = 'composition'
  776.          else
  777.            let g:timdisplaymode = 'code'
  778.          endif
  779.  
  780.          call g:ApplyDisplayMode()
  781.        endfunction
  782.  
  783. "│-v-1 │ Transient settings
  784. "└─────┴────────────────────
  785.  " This is meant for sourcing in convenience settings that don't really
  786.   " belong in this file.
  787.   :source ~/Dropbox/code/ZigZagDungeon/vimsetup.vim
  788.  
  789. " vim: set fmr=-v-,-^- fdm=marker cms=//%s et ts=2 sw=2 :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement