Permalink
Browse files

Merge branch 'various_edits' into experimental

closes #280

* various_edits:
  Rakefile: Invoke folders just after invoking update.
  Vimrc: *.rake are also ruby files.
  Vimrc: Add <leader>hs keymap to toggle hlsearch.
  Vimrc: Put the backup files in ~/.vim/_backup and swap files in ~/.vim/_temp
  Rakefile: Create backup and temp folders.

Conflicts:
	Rakefile
	vimrc
  • Loading branch information...
2 parents be1059e + c904415 commit b56f254bf3da98c6eedc116bae063ec72a0224fe @kalbasit kalbasit committed Nov 2, 2011
Showing with 31 additions and 9 deletions.
  1. +3 −0 .gitignore
  2. +19 −1 Rakefile
  3. +9 −8 vimrc
View
@@ -0,0 +1,3 @@
+# ViM files
+_backup
+_temp
View
@@ -1,3 +1,14 @@
+module Janus
+ module VIM
+ extend self
+
+ # Folders
+ def folders
+ %w[ _backup _temp ]
+ end
+ end
+end
+
# Expand the path of a given file
#
# @param [String] file
@@ -16,10 +27,17 @@ task :link_vim_conf_files do
end
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, :link_vim_conf_files]
+task :default => [:update, :folders, :link_vim_conf_files]
View
17 vimrc
@@ -75,7 +75,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
@@ -116,7 +116,7 @@ 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()
@@ -147,24 +147,25 @@ 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
""
" Insert the current directory into a command-line path
cmap <C-P> <C-R>=expand("%:p:h") . "/"
-
""
-"" 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.
""
-"" Customisations
+"" Customizations
""
if filereadable(expand("~/.vimrc.after"))

0 comments on commit b56f254

Please sign in to comment.