Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update vimrc, remove supertab

  • Loading branch information...
commit 7fee97ec25d9dc722ef385b8a10801ed43f26c88 1 parent 8a0bcb4
@mcramm authored
Showing with 32 additions and 5 deletions.
  1. +0 −3  .gitmodules
  2. +0 −1  vim/bundle/vim-supertab
  3. +32 −1 vim/vimrc
View
3  .gitmodules
@@ -25,9 +25,6 @@
[submodule "vim/bundle/ack.vim"]
path = vim/bundle/ack.vim
url = https://github.com/mileszs/ack.vim.git
-[submodule "vim/bundle/vim-supertab"]
- path = vim/bundle/vim-supertab
- url = https://github.com/tsaleh/vim-supertab.git
[submodule "vim/bundle/vim-pasta"]
path = vim/bundle/vim-pasta
url = https://github.com/sickill/vim-pasta.git
1  vim/bundle/vim-supertab
@@ -1 +0,0 @@
-Subproject commit 096be343f89c63fc086a55262f2f264d0d0524b0
View
33 vim/vimrc
@@ -49,7 +49,7 @@ let mapleader = ","
:map <C-T> :CommandT<CR>
:map <D-T> :CommandT<CR>
-" Remember last location in file
+" Jump to the last line of code when re-opening the file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
@@ -89,6 +89,35 @@ set backupdir=~/.vim/backup
set directory=~/.vim/backup
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Multipurpose tab key
+" Indent if we're at beginning of line, else, do completion
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! InsertTabWrapper()
+ let col = col('.') -1
+ if !col || getline('.')[col - 1] !~ '\k'
+ return "\<tab>"
+ else
+ return "\<c-p>"
+ endif
+endfunction
+inoremap <tab> <c-r>=InsertTabWrapper()<cr>
+inoremap <s-tab> <c-n>
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Rename current file
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! RenameFile()
+ let old_name = expand('%')
+ let new_name = input('New file name: ', expand('%'))
+ if new_name != '' && new_name != old_name
+ exec ':saveas ' . new_name
+ exec ':silent !rm ' .old_name
+ redraw!
+ endif
+endfunction
+map <leader>n :call RenameFile()<cr>
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Keymappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap K <nop>
@@ -108,6 +137,8 @@ map <leader>gt :CommandTFlush<cr>\|:CommandT test/
map <C-j> 10j
map <C-k> 10k
+:nnoremap <CR> :nohlsearch<cr>
+
"" GRB mappings
" Map keys to go to specific files
"
Please sign in to comment.
Something went wrong with that request. Please try again.