Steve Losh committed 4fae0d3

Minor stuff

Comments (0)

Files changed (5)

 ensure_link "lib/dotfiles/hgignore"            ".hgignore"
 ensure_link "lib/dotfiles/gitignore"           ".gitignore"
 ensure_link "lib/dotfiles/ffignore"            ".ffignore"
+ensure_link "lib/dotfiles/agignore"            ".agignore"
 ensure_link "lib/dotfiles/ctags"               ".ctags"
 ensure_link "lib/dotfiles/grc"                 ".grc"
 ensure_link "lib/dotfiles/bash_profile"        ".bash_profile"
 # Useful functions {{{
 function ef; vim ~/.config/fish/; end
+function eff; vim ~/.config/fish/functions; end
 function ev; vim ~/.vimrc; end
 function ed; vim ~/.vim/custom-dictionary.utf-8.add; end
 function eo; vim ~/Dropbox/Org; end


         # that little tidbit and can we please get a shell without complete
         # bullshit as a scripting language syntax?
         if grep -q 'pragma: skipvcs' '.agignore'
+            # If .agignore contains pragma: skipvcs, then we'll run ag in
+            # "disregard .gitignore/.hgignore/svn:ignore" mode.  This lets us
+            # still search in files the VCS has ignored.
             actual_ag --search-files -U $argv
             actual_ag --search-files $argv
 " This should preserve your last yank/delete as well.
 nnoremap zl :let @z=@"<cr>x$p:let @"=@z<cr>
+" Ranger
+nnoremap <leader>r :silent !ranger %:h<cr>:redraw!<cr>
+nnoremap <leader>R :silent !ranger<cr>:redraw!<cr>
 " Insert Mode Completion {{{
 inoremap <c-f> <c-x><c-f>
 xnoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
 function! s:NumberTextObject(whole)
-    normal! v
-    while getline('.')[col('.')] =~# '\v[0-9]'
+    let num = '\v[0-9]'
+    " If the current char isn't a number, walk forward.
+    while getline('.')[col('.') - 1] !~# num
         normal! l
+    " Now that we're on a number, start selecting it.
+    normal! v
+    " If the char after the cursor is a number, select it.
+    while getline('.')[col('.')] =~# num
+        normal! l
+    endwhile
+    " If we want an entire word, flip the select point and walk.
     if a:whole
         normal! o
-        while col('.') > 1 && getline('.')[col('.') - 2] =~# '\v[0-9]'
+        while col('.') > 1 && getline('.')[col('.') - 2] =~# num
             normal! h