Skip to content
Browse files

A bunch of cool changes.

Changed a couple of function names to be more descriptive.
Made BtagComplete simpler.
Changed a few mappings.
Made ,F,S,T slightly more useful.
  • Loading branch information...
1 parent e7d1e03 commit b1d87611d880c5beda4909563627b3d871551190 @romainl committed Feb 28, 2014
Showing with 1,145 additions and 22 deletions.
  1. +7 −10 autoload/functions.vim
  2. +1,129 −2 tags
  3. +9 −10 vimrc
View
17 autoload/functions.vim
@@ -23,7 +23,7 @@ endfunction
" ===========================================================================
" naive MRU
-function functions#ListRecentFiles(ArgLead, CmdLine, CursorPos)
+function functions#MRUComplete(ArgLead, CmdLine, CursorPos)
let the_oldfiles = deepcopy(v:oldfiles)
let my_oldfiles = filter(the_oldfiles, 'v:val =~ a:ArgLead')
@@ -128,11 +128,9 @@ endfunction
" ===========================================================================
" like :tag /foo but the completion is limited to the current buffer
-function functions#ListBufTags(ArgLead, CmdLine, CursorPos)
- " absolute paths are machine/user-dependent
- " Tagit() now uses relative paths so we can
- " do the same here: much simpler
- let temp_list = filter(taglist('/*' . a:ArgLead), 'v:val.filename == bufname("%")')
+function functions#BtagComplete(ArgLead, CmdLine, CursorPos)
+ " let temp_list = filter(taglist('/*' . a:ArgLead), 'v:val.filename == bufname("%")')
+ let temp_list = taglist('/*' . a:ArgLead)
if len(temp_list) > 0
let return_list = []
@@ -284,9 +282,7 @@ endfunction
endfunction
function functions#TagExpander(next)
- if a:next ==# "<" && getline(".")[col(".")] ==# "/"
- let first_after = getline(".")[col(".") + 1]
- echom first_after
+ if a:next ==# "<" && getline(".")[col(".")] ==# "/"
if getline(".")[searchpos("<", "bnW")[1]] ==# "/" || getline(".")[searchpos("<", "bnW")[1]] !=# getline(".")[col(".") + 1]
return "\<CR>"
@@ -410,7 +406,8 @@ function functions#GenerateTags(location, buffer_only)
let tag = system("cd " . shellescape(a:location) . " && " . ctags_command . " -f tags .")
- elseif a:buffer_only == 1
+ elseif a:buffer_only == 1
+ let ctags_command = "ctags -L <(echo " . expand('%') . ")"
" let ctags_command = "echo " . expand('%') . " > /tmp/thisfile && ctags -L /tmp/thisfile"
let tag = system("cd " . shellescape(a:location) . " && " . ctags_command . " -f tags .")
View
1,131 tags
1,129 additions, 2 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
19 vimrc
@@ -72,7 +72,6 @@ set path=**
set previewheight=4
set scrolloff=4
set virtualedit=block
-set winheight=999
augroup VIMRC
autocmd!
@@ -150,11 +149,11 @@ let mapleader = ","
" juggling with files
nnoremap <leader>f :find *
-nnoremap <leader>F :find <C-R>=expand('%:h').'/*'<CR>
+nnoremap <leader>F :find <C-R>=expand('%:p:h').'/**/*'<CR>
nnoremap <leader>s :sfind *
-nnoremap <leader>S :sfind <C-R>=expand('%:h').'/*'<CR>
+nnoremap <leader>S :sfind <C-R>=expand('%:p:h').'/**/*'<CR>
nnoremap <leader>v :vert sfind *
-nnoremap <leader>V :vert sfind <C-R>=expand('%:h').'/*'<CR>
+nnoremap <leader>V :vert sfind <C-R>=expand('%:p:h').'/**/*'<CR>
" juggling with buffers
nnoremap <leader>b :buffer <C-z><S-Tab>
@@ -164,8 +163,8 @@ nnoremap <PageUp> :bp<CR>
nnoremap <PageDown> :bn<CR>
" juggling with windows
-nnoremap <C-Down> <C-w>w
-nnoremap <C-Up> <C-w>W
+nnoremap <C-Down> <C-w>w<C-w>_
+nnoremap <C-Up> <C-w>W<C-w>_
" juggling with lines
nnoremap <leader>k :move-2<CR>==
@@ -290,11 +289,11 @@ command! FM tselect FIXME
command! EV tabnew $MYVIMRC <bar> lcd %:p:h
command! SV source $MYVIMRC
-command! -nargs=1 -complete=customlist,functions#ListBufTags Btag call functions#Btag(<f-args>)
+command! -nargs=1 -complete=customlist,functions#BtagComplete Btag call functions#Btag(<f-args>)
-command! -nargs=1 -complete=customlist,functions#ListRecentFiles MRU call functions#MRU("edit", <f-args>)
-command! -nargs=1 -complete=customlist,functions#ListRecentFiles MRUS call functions#MRU("split", <f-args>)
-command! -nargs=1 -complete=customlist,functions#ListRecentFiles MRUV call functions#MRU("vsplit", <f-args>)
+command! -nargs=1 -complete=customlist,functions#MRUComplete MRU call functions#MRU("edit", <f-args>)
+command! -nargs=1 -complete=customlist,functions#MRUComplete MRUS call functions#MRU("split", <f-args>)
+command! -nargs=1 -complete=customlist,functions#MRUComplete MRUV call functions#MRU("vsplit", <f-args>)
command! -nargs=1 Qfdo call functions#Qfdo(0)
command! -nargs=1 Qfdofile call functions#Qfdo(1)

0 comments on commit b1d8761

Please sign in to comment.
Something went wrong with that request. Please try again.