Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Experimental] Various edits #280

Closed
wants to merge 12 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
3  .gitignore
@@ -0,0 +1,3 @@
+# ViM files
+_backup
+_temp
View
20 Rakefile
@@ -1,3 +1,14 @@
+module Janus
+ module VIM
+ extend self
+
+ # Folders
+ def folders
+ %w[ _backup _temp ]
+ end
+ end
+end
+
def expand(file)
File.expand_path(file)
end
@@ -10,10 +21,17 @@ task expand("~/.gvimrc") => "gvimrc" do
sh "ln -s ~/.vim/gvimrc ~/.gvimrc"
end
+desc "Create necessary folders."
+task :folders do
+ Janus::VIM.folders.each do |folder|
+ mkdir_p folder
+ end
+end
+
task :update do
sh "git pull"
sh "git submodule init"
sh "git submodule update"
end
-task :default => [:update, expand("~/.vimrc"), expand("~/.gvimrc")]
+task :default => [:update, :folders, expand("~/.vimrc"), expand("~/.gvimrc")]
View
14 janus-command-t/janus/plugin/command-t.vim
@@ -1,6 +1,18 @@
if has("gui_macvim")
macmenu &File.New\ Tab key=<nop>
+
map <D-t> :CommandT<CR>
- imap <D-t> <Esc>:CommandT<CR>
+ imap <D-t> <ESC>:CommandT<CR>
+
+ map <D-M-t> :CommandTFlush<CR>
+ imap <D-M-t> <ESC>:CommandTFlush<CR>
+else
+ map <C-t> :CommandT<CR>
+ imap <C-t> <ESC>:CommandT<CR>
+
+ map <C-M-t> :CommandTFlush<CR>
+ imap <C-M-t> <ESC>:CommandTFlush<CR>
endif
+map <M-t> :CommandTBuffer<CR>
+imap <M-t> <ESC>:CommandTBuffer<CR>
View
3  janus-core/janus/after/plugin/NERD_commenter.vim
@@ -1,4 +1,7 @@
if has("gui_macvim")
map <D-/> <plug>NERDCommenterToggle<CR>
imap <D-/> <Esc><plug>NERDCommenterToggle<CR>i
+else
+ map <leader>/ <plug>NERDCommenterToggle<CR>
+ imap <leader>/ <Esc><plug>NERDCommenterToggle<CR>i
endif
View
14 janus-core/janus/plugin/janus.vim
@@ -12,4 +12,18 @@ if has("gui_macvim")
imap <D-]> <Esc>>>i
imap <D-[> <Esc><<i
+else
+ " Map command-[ and command-] to indenting or outdenting
+ " while keeping the original selection in visual mode
+ vmap <A-]> >gv
+ vmap <A-[> <gv
+
+ nmap <A-]> >>
+ nmap <A-[> <<
+
+ omap <A-]> >>
+ omap <A-[> <<
+
+ imap <A-]> <Esc>>>i
+ imap <A-[> <Esc><<i
endif
View
2  janus-tools/janus/after/plugin/zoomwin.vim
@@ -0,0 +1,2 @@
+" Map <Leader><Leader> to ZoomWin
+map <Leader><Leader> :ZoomWin<CR>
View
0  janus-tools/janus/plugin/zoomwin.vim
No changes.
View
27 vimrc
@@ -3,7 +3,7 @@
""
" Some file types should wrap their text
-function s:setupWrapping()
+function! s:setupWrapping()
set wrap
set linebreak
set textwidth=72
@@ -12,7 +12,7 @@ endfunction
let s:current_file = expand("<sfile>:p")
-function s:add_group(name)
+function! s:add_group(name)
let resolved = resolve(s:current_file)
let dir = fnamemodify(resolved, ":h")
let file = dir . "/" . a:name
@@ -67,7 +67,7 @@ set backspace=indent,eol,start " backspace through everything in insert m
"" Searching
""
-set hlsearch " highlight matches (TODO: Map something convenient to nohlsearch)
+set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
@@ -78,7 +78,9 @@ set smartcase " ... unless they contain at least one capital letter
" TODO: Investigate the precise meaning of these settings
" set wildmode=list:longest,list:full
-" set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
+
+" Disable output and VCS files
+set wildignore+=*.o,*.out,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*,.bundle/*,.sass-cache/*
""
"" Status bar
@@ -108,10 +110,10 @@ filetype plugin indent on " Turn on filetype plugins (:help filetype-plugin)
au FileType make set noexpandtab
" Set the Ruby filetype for a number of common Ruby files without .rb
-au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
+au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru,*.rake} set ft=ruby
-" Markdown and txt files should wrap
-au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} call s:setupWrapping()
+" Make sure all mardown files have the correct filetype set and setup wrapping
+au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} set ft=markdown | call s:setupWrapping()
" Treat JSON files like JavaScript
au BufNewFile,BufRead *.json set ft=javascript
@@ -136,8 +138,8 @@ map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
map <Down> gj
map <Up> gk
-" Map <Leader><Leader> to ZoomWin
-map <Leader><Leader> :ZoomWin<CR>
+" Toggle hlsearch with <leader>hs
+nmap <leader>hs :set hlsearch! hlsearch?<CR>
""
"" Command-Line Mappings
@@ -156,9 +158,8 @@ if filereadable(expand("~/.vimrc.after"))
endif
""
-"" Disable swap files
+"" Backup and swap files
""
-set nobackup
-set nowritebackup
-set noswapfile
+set backupdir=~/.vim/_backup " where to put backup files.
+set directory=~/.vim/_temp " where to put swap files.
Something went wrong with that request. Please try again.