my dotz
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Sane vim config & bitquabit

+356 -153
+1
.config/rss-feeds.txt
··· 11 11 https://puri.sm/feed 12 12 https://blog.tildes.net/all.atom.xml 13 13 https://100r.co/links/rss.xml 14 + https://www.bitquabit.com/index.xml
+355 -153
.vimrc
··· 1 - set nocompatible 2 - filetype off 1 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 + " Maintainer: 3 + " Amir Salihefendic — @amix3k 4 + " 5 + " Awesome_version: 6 + " Get this config, nice color schemes and lots of plugins! 7 + " 8 + " Install the awesome version from: 9 + " 10 + " https://github.com/amix/vimrc 11 + " 12 + " Sections: 13 + " -> General 14 + " -> VIM user interface 15 + " -> Colors and Fonts 16 + " -> Files and backups 17 + " -> Text, tab and indent related 18 + " -> Visual mode related 19 + " -> Moving around, tabs and buffers 20 + " -> Status line 21 + " -> Editing mappings 22 + " -> vimgrep searching and cope displaying 23 + " -> Spell checking 24 + " -> Misc 25 + " -> Helper functions 26 + " 27 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 3 28 4 - set rtp+=~/.vim/bundle/Vundle.vim 5 - call vundle#begin() 6 29 7 - " Bundles 8 - " Actual plugins 9 - Plugin 'VundleVim/Vundle.vim' 10 - Plugin 'tpope/vim-fugitive' 11 - Plugin 'kien/ctrlp.vim' 12 - Plugin 'tpope/vim-surround' 13 - Plugin 'tpope/vim-repeat' 14 - Plugin 'editorconfig/editorconfig-vim' 15 - Plugin 'gerw/vim-HiLinkTrace' 16 - " Meta plugins 17 - Plugin 'vim-scripts/ingo-library' 18 - Plugin 'vim-scripts/SyntaxRange' 19 - " Syntax highlighting 20 - Plugin 'plasticboy/vim-markdown' 21 - Plugin 'cespare/vim-toml' 22 - Plugin 'rust-lang/rust.vim' 23 - Plugin 'mxw/vim-jsx' 24 - Plugin 'pangloss/vim-javascript' 25 - Plugin 'kchmck/vim-coffee-script' 26 - Plugin 'google/vim-jsonnet' 27 - Plugin 'sirtaj/vim-openscad' 28 - Plugin 'leafgarland/typescript-vim' 29 - Plugin 'beyondmarc/glsl.vim' 30 - Plugin 'vim-scripts/scons.vim' 31 - Plugin 'calviken/vim-gdscript3' 32 - Plugin 'wannesm/wmgraphviz.vim' 33 - Plugin 'sotte/presenting.vim' 34 - Plugin 'ziglang/zig.vim' 35 - Plugin 'gpanders/vim-scdoc' 36 - " /Bundles 30 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 31 + " => General 32 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 33 + " Sets how many lines of history VIM has to remember 34 + set history=500 35 + 36 + " Enable filetype plugins 37 + filetype plugin on 38 + filetype indent on 39 + 40 + " Set to auto read when a file is changed from the outside 41 + set autoread 42 + au FocusGained,BufEnter * checktime 43 + 44 + " With a map leader it's possible to do extra key combinations 45 + " like <leader>w saves the current file 46 + let mapleader = "," 47 + 48 + " Fast saving 49 + nmap <leader>w :w!<cr> 37 50 38 - call vundle#end() 51 + " :W sudo saves the file 52 + " (useful for handling the permission-denied error) 53 + command! W execute 'w !sudo tee % > /dev/null' <bar> edit! 39 54 40 - filetype plugin indent on 41 55 42 - set laststatus=2 43 - set t_Co=256 56 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 57 + " => VIM user interface 58 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 59 + " Set 7 lines to the cursor - when moving vertically using j/k 60 + set so=7 44 61 45 - let g:vim_markdown_folding_disabled=1 46 - let g:vim_markdown_frontmatter=1 47 - let g:jsx_ext_required = 0 62 + " Avoid garbled characters in Chinese language windows OS 63 + let $LANG='en' 64 + set langmenu=en 65 + source $VIMRUNTIME/delmenu.vim 66 + source $VIMRUNTIME/menu.vim 48 67 49 - set encoding=utf-8 50 - set tabstop=4 51 - set shiftwidth=4 52 - set autoindent 53 - set magic " unbreak vim's regex implementation 68 + " Turn on the Wild menu 69 + set wildmenu 54 70 55 - set number 56 - set scrolloff=3 57 - set sidescroll=3 71 + " Ignore compiled files 72 + set wildignore=*.o,*~,*.pyc 73 + if has("win16") || has("win32") 74 + set wildignore+=.git\*,.hg\*,.svn\* 75 + else 76 + set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store 77 + endif 58 78 79 + "Always show current position 59 80 set ruler 60 - set cc=80 61 - set nowrap 81 + 82 + " Height of the command bar 83 + set cmdheight=1 84 + 85 + " A buffer becomes hidden when it is abandoned 86 + set hid 62 87 88 + " Configure backspace so it acts as it should act 89 + set backspace=eol,start,indent 90 + set whichwrap+=<,>,h,l 91 + 92 + " Ignore case when searching 63 93 set ignorecase 64 - set smartcase 65 94 66 - set splitbelow 67 - set hidden 68 - set notimeout 95 + " When searching try to be smart about cases 96 + set smartcase 69 97 70 - " Search as you type, highlight results 71 - set incsearch 72 - set showmatch 98 + " Highlight search results 73 99 set hlsearch 74 100 75 - " eff mouz 76 - set mouse=a 101 + " Makes search act like search in modern browsers 102 + set incsearch 77 103 78 - " Don't litter swp files everywhere 79 - set backupdir=~/.cache 80 - set directory=~/.cache 104 + " Don't redraw while executing macros (good performance config) 105 + set lazyredraw 81 106 82 - set nofoldenable 83 - set lazyredraw 107 + " For regular expressions turn magic on 108 + set magic 84 109 85 - set tags=./tags; 110 + " Show matching brackets when text indicator is over them 111 + set showmatch 112 + " How many tenths of a second to blink when matching brackets 113 + set mat=2 86 114 87 - set printheader=\ 115 + " No annoying sound on errors 116 + set noerrorbells 117 + set novisualbell 118 + set t_vb= 119 + set tm=500 88 120 89 - syntax on 90 - let mapleader = "\<space>" 91 - nnoremap \\ :noh<cr> " Clear higlighting 92 - nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> " Trim trailing spaces 93 - nnoremap Y y$ 94 - nnoremap cc :center<cr> 95 - inoremap <C-c> <ESC> 96 - " Ex mode is fucking dumb 97 - nnoremap Q <Nop> 121 + " Properly disable sound on errors on MacVim 122 + if has("gui_macvim") 123 + autocmd GUIEnter * set vb t_vb= 124 + endif 98 125 99 - command Jp e ++enc=euc-jp 100 126 101 - " Preferences for various file formats 102 - autocmd FileType c setlocal noet ts=4 sw=4 tw=80 103 - autocmd FileType h setlocal noet ts=4 sw=4 tw=80 104 - autocmd FileType cpp setlocal noet ts=4 sw=4 tw=80 105 - autocmd FileType s setlocal noet ts=4 sw=4 106 - autocmd FileType go setlocal noet ts=4 sw=4 107 - autocmd FileType hy setlocal filetype=lisp 108 - autocmd FileType sh setlocal noet ts=4 sw=4 109 - autocmd BufRead,BufNewFile *.js setlocal et ts=2 sw=2 110 - autocmd FileType html setlocal et ts=2 sw=2 111 - autocmd FileType htmldjango setlocal et ts=2 sw=2 112 - autocmd FileType ruby setlocal et ts=2 sw=2 113 - autocmd FileType scss setlocal et ts=2 sw=2 114 - autocmd FileType yaml setlocal et ts=2 sw=2 115 - autocmd FileType markdown setlocal tw=80 et ts=2 sw=2 116 - autocmd FileType text setlocal tw=80 117 - autocmd FileType meson setlocal noet ts=2 sw=2 118 - autocmd FileType bzl setlocal et ts=2 sw=2 119 - autocmd FileType typescript setlocal et ts=2 sw=2 120 - autocmd FileType python setlocal et ts=4 sw=4 121 - autocmd BufNewFile,BufRead *.ms set syntax=python ts=4 sw=4 noet 122 - autocmd FileType tex hi Error ctermbg=NONE 123 - autocmd FileType mail setlocal noautoindent 124 - augroup filetypedetect 125 - autocmd BufRead,BufNewFile *mutt-* setfiletype mail 126 - augroup filetypedetect 127 - autocmd BufRead,BufNewFile *qutebrowser-editor-* set ts=4 sw=4 et 128 - autocmd BufNewFile,BufRead * if expand('%:t') == 'APKBUILD' | set ft=sh | endif 129 - autocmd BufNewFile,BufRead * if expand('%:t') == 'PKGBUILD' | set ft=sh | endif 127 + " Add a bit extra margin to the left 128 + set foldcolumn=1 130 129 131 - set guioptions-=m 132 - set guioptions-=T 133 - set guioptions-=r 134 - set guioptions-=e 135 130 136 - nmap <leader>l :set list!<CR> 137 - set listchars=tab:▸\ ,eol:¬,space:. 131 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 132 + " => Colors and Fonts 133 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 134 + " Enable syntax highlighting 135 + syntax enable 138 136 139 - syntax enable 140 - colorscheme ron 141 - highlight Search ctermbg=12 142 - highlight NonText ctermfg=darkgrey 143 - highlight SpecialKey ctermfg=darkgrey 144 - highlight clear SignColumn 145 - highlight Comment cterm=bold ctermfg=none 146 - highlight StatusLine cterm=none ctermbg=none ctermfg=darkgrey 147 - highlight StatusLineNC cterm=none ctermbg=none ctermfg=darkgrey 148 - highlight Title cterm=none ctermfg=darkgrey 149 - highlight TabLineFill cterm=none 150 - highlight TabLine cterm=none ctermfg=darkgrey ctermbg=none 151 - highlight ColorColumn ctermbg=darkgrey guibg=lightgrey 152 - highlight jsParensError ctermbg=NONE 153 - highlight Todo ctermbg=NONE ctermfg=red cterm=bold 154 - highlight PreProc ctermfg=grey 155 - highlight String ctermfg=darkblue cterm=italic 156 - highlight Type ctermfg=darkblue 157 - highlight lineNr ctermfg=grey cterm=italic 158 - highlight cIncluded ctermfg=NONE cterm=bold 159 - highlight pythonInclude ctermfg=blue 160 - highlight pythonConditional ctermfg=darkcyan 161 - highlight pythonBuiltin ctermfg=darkcyan 162 - highlight Pmenu ctermbg=white ctermfg=black 163 - highlight PmenuSel ctermbg=darkcyan ctermfg=black 137 + " Enable 256 colors palette in Gnome Terminal 138 + if $COLORTERM == 'gnome-terminal' 139 + set t_Co=256 140 + endif 164 141 165 - " Transparent editing of gpg encrypted files. 166 - " By Wouter Hanegraaff 167 - augroup encrypted 168 - au! 169 - autocmd BufReadPre,FileReadPre *.gpg set viminfo= 170 - autocmd BufReadPre,FileReadPre *.gpg set noswapfile noundofile nobackup 171 - autocmd BufReadPre,FileReadPre *.gpg set bin 172 - autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2 173 - autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt 2> /dev/null 174 - autocmd BufReadPost,FileReadPost *.gpg set nobin 175 - autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save 176 - autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r") 177 - autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --default-recipient-self -ae 2>/dev/null 178 - autocmd BufWritePost,FileWritePost *.gpg u 179 - augroup END 142 + try 143 + colorscheme desert 144 + catch 145 + endtry 146 + 147 + set background=dark 148 + 149 + " Set extra options when running in GUI mode 150 + if has("gui_running") 151 + set guioptions-=T 152 + set guioptions-=e 153 + set t_Co=256 154 + set guitablabel=%M\ %t 155 + endif 156 + 157 + " Set utf8 as standard encoding and en_US as the standard language 158 + set encoding=utf8 159 + 160 + " Use Unix as the standard file type 161 + set ffs=unix,dos,mac 162 + 163 + 164 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 165 + " => Files, backups and undo 166 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 167 + " Turn backup off, since most stuff is in SVN, git etc. anyway... 168 + set nobackup 169 + set nowb 170 + set noswapfile 171 + 172 + 173 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 174 + " => Text, tab and indent related 175 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 176 + " Use spaces instead of tabs 177 + set expandtab 178 + 179 + " Be smart when using tabs ;) 180 + set smarttab 181 + 182 + " 1 tab == 4 spaces 183 + set shiftwidth=4 184 + set tabstop=4 185 + 186 + " Linebreak on 500 characters 187 + set lbr 188 + set tw=500 189 + 190 + set ai "Auto indent 191 + set si "Smart indent 192 + set wrap "Wrap lines 193 + 194 + 195 + """""""""""""""""""""""""""""" 196 + " => Visual mode related 197 + """""""""""""""""""""""""""""" 198 + " Visual mode pressing * or # searches for the current selection 199 + " Super useful! From an idea by Michael Naumann 200 + vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR> 201 + vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR> 202 + 203 + 204 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 205 + " => Moving around, tabs, windows and buffers 206 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 207 + " Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search) 208 + map <space> / 209 + map <C-space> ? 210 + 211 + " Disable highlight when <leader><cr> is pressed 212 + map <silent> <leader><cr> :noh<cr> 213 + 214 + " Smart way to move between windows 215 + map <C-j> <C-W>j 216 + map <C-k> <C-W>k 217 + map <C-h> <C-W>h 218 + map <C-l> <C-W>l 219 + 220 + " Close the current buffer 221 + map <leader>bd :Bclose<cr>:tabclose<cr>gT 222 + 223 + " Close all the buffers 224 + map <leader>ba :bufdo bd<cr> 225 + 226 + map <leader>l :bnext<cr> 227 + map <leader>h :bprevious<cr> 228 + 229 + " Useful mappings for managing tabs 230 + map <leader>tn :tabnew<cr> 231 + map <leader>to :tabonly<cr> 232 + map <leader>tc :tabclose<cr> 233 + map <leader>tm :tabmove 234 + map <leader>t<leader> :tabnext 235 + 236 + " Let 'tl' toggle between this and the last accessed tab 237 + let g:lasttab = 1 238 + nmap <Leader>tl :exe "tabn ".g:lasttab<CR> 239 + au TabLeave * let g:lasttab = tabpagenr() 240 + 241 + 242 + " Opens a new tab with the current buffer's path 243 + " Super useful when editing files in the same directory 244 + map <leader>te :tabedit <C-r>=expand("%:p:h")<cr>/ 245 + 246 + " Switch CWD to the directory of the open buffer 247 + map <leader>cd :cd %:p:h<cr>:pwd<cr> 248 + 249 + " Specify the behavior when switching between buffers 250 + try 251 + set switchbuf=useopen,usetab,newtab 252 + set stal=2 253 + catch 254 + endtry 180 255 181 - let g:presenting_top_margin = 2 256 + " Return to last edit position when opening files (You want this!) 257 + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 258 + 259 + 260 + """""""""""""""""""""""""""""" 261 + " => Status line 262 + """""""""""""""""""""""""""""" 263 + " Always show the status line 264 + set laststatus=2 265 + 266 + " Format the status line 267 + set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c 268 + 269 + 270 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 271 + " => Editing mappings 272 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 273 + " Remap VIM 0 to first non-blank character 274 + map 0 ^ 275 + 276 + " Move a line of text using ALT+[jk] or Command+[jk] on mac 277 + nmap <M-j> mz:m+<cr>`z 278 + nmap <M-k> mz:m-2<cr>`z 279 + vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z 280 + vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z 281 + 282 + if has("mac") || has("macunix") 283 + nmap <D-j> <M-j> 284 + nmap <D-k> <M-k> 285 + vmap <D-j> <M-j> 286 + vmap <D-k> <M-k> 287 + endif 288 + 289 + " Delete trailing white space on save, useful for some filetypes ;) 290 + fun! CleanExtraSpaces() 291 + let save_cursor = getpos(".") 292 + let old_query = getreg('/') 293 + silent! %s/\s\+$//e 294 + call setpos('.', save_cursor) 295 + call setreg('/', old_query) 296 + endfun 297 + 298 + if has("autocmd") 299 + autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee :call CleanExtraSpaces() 300 + endif 301 + 302 + 303 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 304 + " => Spell checking 305 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 306 + " Pressing ,ss will toggle and untoggle spell checking 307 + map <leader>ss :setlocal spell!<cr> 308 + 309 + " Shortcuts using <leader> 310 + map <leader>sn ]s 311 + map <leader>sp [s 312 + map <leader>sa zg 313 + map <leader>s? z= 314 + 315 + 316 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 317 + " => Misc 318 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 319 + " Remove the Windows ^M - when the encodings gets messed up 320 + noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm 321 + 322 + " Quickly open a buffer for scribble 323 + map <leader>q :e ~/buffer<cr> 324 + 325 + " Quickly open a markdown buffer for scribble 326 + map <leader>x :e ~/buffer.md<cr> 327 + 328 + " Toggle paste mode on and off 329 + map <leader>pp :setlocal paste!<cr> 330 + 331 + 332 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 333 + " => Helper functions 334 + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 335 + " Returns true if paste mode is enabled 336 + function! HasPaste() 337 + if &paste 338 + return 'PASTE MODE ' 339 + endif 340 + return '' 341 + endfunction 342 + 343 + " Don't close window, when deleting a buffer 344 + command! Bclose call <SID>BufcloseCloseIt() 345 + function! <SID>BufcloseCloseIt() 346 + let l:currentBufNum = bufnr("%") 347 + let l:alternateBufNum = bufnr("#") 348 + 349 + if buflisted(l:alternateBufNum) 350 + buffer # 351 + else 352 + bnext 353 + endif 354 + 355 + if bufnr("%") == l:currentBufNum 356 + new 357 + endif 358 + 359 + if buflisted(l:currentBufNum) 360 + execute("bdelete! ".l:currentBufNum) 361 + endif 362 + endfunction 363 + 364 + function! CmdLine(str) 365 + call feedkeys(":" . a:str) 366 + endfunction 367 + 368 + function! VisualSelection(direction, extra_filter) range 369 + let l:saved_reg = @" 370 + execute "normal! vgvy" 371 + 372 + let l:pattern = escape(@", "\\/.*'$^~[]") 373 + let l:pattern = substitute(l:pattern, "\n$", "", "") 374 + 375 + if a:direction == 'gv' 376 + call CmdLine("Ack '" . l:pattern . "' " ) 377 + elseif a:direction == 'replace' 378 + call CmdLine("%s" . '/'. l:pattern . '/') 379 + endif 380 + 381 + let @/ = l:pattern 382 + let @" = l:saved_reg 383 + endfunction