Guest User

Untitled

a guest
May 7th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 5.88 KB | None | 0 0
  1. cmap w!! %!sudo tee > /dev/null %
  2.  
  3. nnoremap <a-j> :m+<CR>==
  4. nnoremap <A-k> :m-2<CR>==
  5. nnoremap <A-h> <<
  6. nnoremap <A-l> >>
  7. noremap <A-j> <Esc>:m+<CR>==gi
  8. inoremap <A-k> <Esc>:m-2<CR>==gi
  9. inoremap <A-h> <Esc><<]a
  10. inoremap <A-l> <Esc>>>]a
  11. vnoremap <A-j> :m'>+<CR>gv=gv
  12. vnoremap <A-k> :m-2<CR>gv=gv
  13. vnoremap <A-h> <gv
  14. vnoremap <A-l> >gv
  15.  
  16. cd ~/Documents/Forritun/Python
  17. "remove trailing whitespace? map þetta: %s/\s\+$//ge
  18.  
  19. "set clipboard=unnamedplus,autoselect " Use + register (X Window clipboard) as unnamed register
  20. set ofu=syntaxcomplete#Complete
  21. set nocompatible    "Do not use archaic vi settings.
  22. set history=700     "Remember 700 changes (?).
  23. set ignorecase      "Ignore case when searching.
  24. set smartcase       "Ignore case unless it's uppercase.
  25. set incsearch       "Use incremental search
  26. set ruler       "Always show cursor position.
  27. set ttyfast     "Smooth changes (?).
  28. set expandtab       "No 'real' tab.
  29. set noerrorbells    "No sound on errors.
  30. set novisualbell    "No visual warning on errors.
  31. set t_vb=       "(?).
  32. set tm=500      "(?).
  33. set showcmd     "Show the command being typed.
  34. set mousehide       "Hide the mouse while typing.
  35. set cursorcolumn    "Highlight the column of the cursor.
  36. set cursorline      "Higlight the row of the cursor.
  37.  
  38. set colorcolumn=80
  39.  
  40. "set virtualedit=onemore    "Allow the cursor to go one behind the last symbol.
  41. set listchars=tab:>-,trail:-    "Show tabs and trailing (?).
  42. set nobackup        "No backups.
  43. set noswapfile      "No swap files.
  44. set nowb        "(?).
  45. set number      "Show line numbers.
  46. set numberwidth=4       "Width doesn't change unless the file is >9999 lines.
  47. set tabstop=8       "(?).
  48. set softtabstop=4   "(?).
  49. set shiftwidth=4    "(?).
  50. set scrolloff=3         "Do not move the cursor above/below this threshold.
  51. set undofile            "Create undo files to undo/redo after reopening files.
  52. set wildmenu            "For tab completion when searching.
  53. set wildmode=list:longest   "Same as above. Tab completion,
  54. "set list
  55. "set listchars=tab:▸\ ,eol:¬ "For visibility.
  56. "set listchars=tab:»·,nbsp:·
  57. "set autowrite          "Automatically write (save).
  58. set autoindent      "Use autoindent.
  59. set pastetoggle=<F12>   "To work around the autoindent.
  60. set textwidth=79    "For Python.
  61. set lines=67        "Show as many as possible.
  62. set columns=83          "To show 79 characters + 4 number spaces.
  63. "set columns=166         "To show 79 characters + 4 number spaces.
  64. "set scrollbind
  65. ":noremap <silent> <Leader>vs :<C-u>let @z=&so<CR>:set so=0 noscb<CR>:bo vs<CR>Ljzt:setl scb<CR><C-w>p:setl scb<CR>:let &so=@z<CR>
  66. syntax enable       "Enable syntax highlighting.
  67. winpos 0 24     "Adjust to the edge of the screen.
  68. filetype indent plugin on   "Enable the filetype indent plugin.
  69. set background=dark "Use a dark background by default.
  70. set t_Co=16     "Use 16 colors.
  71. let g:solarized_termcolors=16  "Use 16 colors.
  72. colorscheme solarized   "Use the Solarized colorscheme.
  73. au FocusLost * :wa
  74. map <up> :set number<CR>
  75. map <down> :set relativenumber<CR>
  76. map <left> :set background=light<CR>
  77. map <right> :set background=dark<CR>
  78. map <F4> :w<CR>
  79. map <F3> :silent! %s/\s+$//<CR>:retab<CR>
  80. imap <F4> <ESC>:w<CR>
  81. map <F5> :!python %<CR>
  82. map K <nop>
  83. "map <space> ^
  84. noremap <space> :
  85. imap <up> <nop>
  86. map K i'<esc>ea'<esc>b
  87. imap <down> <nop>
  88. imap <left> <nop>
  89. imap <right> <nop>
  90. imap <S-'> <'><'><left>
  91. "imap jj <ESC>
  92. "imap ( ():<left><left>
  93. "inoremap <Esc> <Esc>`^  
  94. autocmd BufReadPre *.doc set ro
  95. autocmd BufReadPre *.doc set hlsearch!
  96. autocmd BufReadPost *.doc %!antiword "%"
  97. "au CursorHoldI * stopinsert
  98. "set updtatetime 2000
  99. function! PulseCursorLine()
  100.    let current_window = winnr()
  101.  
  102.    windo set nocursorline
  103.    execute current_window . 'wincmd w'
  104.  
  105.    setlocal cursorline
  106.  
  107.    redir => old_hi
  108.        silent execute 'hi CursorLine'
  109.    redir END
  110.    let old_hi = split(old_hi, '\n')[0]
  111.    let old_hi = substitute(old_hi, 'xxx', '', '')
  112.  
  113.    hi CursorLine guibg=#2a2a2a ctermbg=233
  114.    redraw
  115.    sleep 20m
  116.  
  117.    hi CursorLine guibg=#333333 ctermbg=235
  118.    redraw
  119.    sleep 20m
  120.  
  121.    hi CursorLine guibg=#3a3a3a ctermbg=237
  122.    redraw
  123.    sleep 20m
  124.  
  125.    hi CursorLine guibg=#444444 ctermbg=239
  126.    redraw
  127.    sleep 20m
  128.  
  129.    hi CursorLine guibg=#3a3a3a ctermbg=237
  130.    redraw
  131.    sleep 20m
  132.  
  133.    hi CursorLine guibg=#333333 ctermbg=235
  134.    redraw
  135.    sleep 20m
  136.  
  137.    hi CursorLine guibg=#2a2a2a ctermbg=233
  138.    redraw
  139.    sleep 20m
  140.  
  141.    execute 'hi ' . old_hi
  142.  
  143.    windo set cursorline
  144.    execute current_window . 'wincmd w'
  145. endfunction
  146.  
  147.  
  148. function! ToggleMinimap()
  149.        if exists("s:isMini") && s:isMini == 0
  150.                let s:isMini = 1
  151.        else
  152.                let s:isMini = 0
  153.        end
  154.  
  155.        if (s:isMini == 0)
  156.                " save current visible lines
  157.                let s:firstLine = line("w0")
  158.                let s:lastLine = line("w$")
  159.  
  160.                " resize each window
  161.                " windo let w=winwidth(0)*12 | exe "set winwidth=" . w
  162.                " windo let h=winheight(0)*12 | exe "set winheight=" . h
  163.  
  164.                " don't change window size
  165.                 let c = &columns * 12
  166.                 let l = &lines * 12
  167.                 exe "set columns=" . c
  168.                 exe "set lines=" . l
  169.  
  170.                 " make font small
  171.                 set guifont=ProggyTiny:h1
  172.                
  173.                 " highlight lines which were visible
  174.                 let s:lines = ""
  175.                 for i in range(s:firstLine, s:lastLine)
  176.                         let s:lines = s:lines . "\\%" . i . "l"
  177.  
  178.                         if i < s:lastLine
  179.                                 let s:lines = s:lines . "\\|"
  180.                         endif
  181.                 endfor
  182.  
  183.                 exe 'match Visible /' . s:lines . '/'
  184.                 hi Visible guibg=lightblue guifg=black term=bold
  185.         else
  186.                 set guifont=Menlo:h12
  187.                 hi clear Visible
  188.         endif
  189. endfunction
  190.  
  191. command! ToggleMinimap call ToggleMinimap()
  192. noremap m :ToggleMinimap<CR>
Add Comment
Please, Sign In to add comment