4fae0d361139

Minor stuff
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 12 Mar 2014 11:31:36 -0400
parents 021398e3fd15
children 2d90283382c3
branches/tags (none)
files agignore bin/bootstrap.sh fish/config.fish fish/functions/ag.fish vim/vimrc

Changes

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agignore	Wed Mar 12 11:31:36 2014 -0400
@@ -0,0 +1,6 @@
+tags
+tags.bak
+*.wsdl
+target
+*.public.key
+*.private.key
--- a/bin/bootstrap.sh	Wed Mar 05 14:10:40 2014 -0500
+++ b/bin/bootstrap.sh	Wed Mar 12 11:31:36 2014 -0400
@@ -43,6 +43,7 @@
 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"
--- a/fish/config.fish	Wed Mar 05 14:10:40 2014 -0500
+++ b/fish/config.fish	Wed Mar 12 11:31:36 2014 -0400
@@ -1,6 +1,7 @@
 # Useful functions {{{
 
 function ef; vim ~/.config/fish/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
--- a/fish/functions/ag.fish	Wed Mar 05 14:10:40 2014 -0500
+++ b/fish/functions/ag.fish	Wed Mar 12 11:31:36 2014 -0400
@@ -22,6 +22,9 @@
         # 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
         else
             actual_ag --search-files $argv
--- a/vim/vimrc	Wed Mar 05 14:10:40 2014 -0500
+++ b/vim/vimrc	Wed Mar 12 11:31:36 2014 -0400
@@ -459,6 +459,10 @@
 " 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>
@@ -1805,16 +1809,26 @@
 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
     endwhile
 
+    " 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
         endwhile
     endif