Skip to content

Commit

Permalink
Set default and appends in order
Browse files Browse the repository at this point in the history
  • Loading branch information
KMNK authored and KMNK committed May 4, 2014
1 parent 7f5cd3b commit e0d0c9b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 101 deletions.
2 changes: 0 additions & 2 deletions dotfiles/dot.vimrc
Expand Up @@ -40,8 +40,6 @@ let s:profile_names = [
\ 'unite',
\ 'maps',
\ 'plugins',
\ 'functions',
\ 'tmp',
\ 'local-appends',
\ 'local-bundles',
\ 'local-maps',
Expand Down
2 changes: 1 addition & 1 deletion vim/dot.vim/ftdetect/clojure.vim
@@ -1 +1 @@
au BufRead,BufNewFile *.clj set filetype=clojure
autocmd BufRead,BufNewFile *.clj setlocal filetype=clojure
2 changes: 1 addition & 1 deletion vim/dot.vim/ftdetect/coffee.vim
@@ -1 +1 @@
au BufRead,BufNewFile *.coffee set filetype=coffee
autocmd BufRead,BufNewFile *.coffee setlocal filetype=coffee
1 change: 1 addition & 0 deletions vim/dot.vim/ftdetect/javascript.vim
@@ -0,0 +1 @@
autocmd BufRead,BufNewFile *.js setlocal filetype=javascript
1 change: 0 additions & 1 deletion vim/dot.vim/ftdetect/perltest.vim

This file was deleted.

2 changes: 1 addition & 1 deletion vim/dot.vim/ftdetect/tmpl.vim
@@ -1 +1 @@
au BufRead,BufNewFile *.tmpl set filetype=html
autocmd BufRead,BufNewFile *.tmpl setlocal filetype=html
56 changes: 9 additions & 47 deletions vim/profiles/appends.vim
Expand Up @@ -33,18 +33,12 @@ let g:html_use_css = 1
let g:html_no_pre = 1

" help key map
nnoremap <SID>(help-shortcut) :<C-u>h<Space>
inoremap <SID>(backspace) <BS>
inoremap <SID>(backspace) <BS>
" edit vimrc right now
nnoremap <silent> <SID>(edit-vimrc) :<C-u>tabedit $MYVIMRC<CR>
nnoremap <silent> <SID>(edit-gvimrc) :<C-u>tabedit $MYGVIMRC<CR>
" useful commands {{{
" rename by one command
command! -nargs=1 -complete=file Rename f <args>|call delete(expand('#'))
"}}}

" no guioptions
if has('gui_running')
set go=
Expand Down Expand Up @@ -95,28 +89,28 @@ endfunction
"}}}

" Command-line window {{{
nmap <SID>(command-line-enter) q:
xmap <SID>(command-line-enter) q:
nmap <SID>(command-line-norange) q:<C-u>
nmap : <SID>(command-line-enter)
xmap : <SID>(command-line-enter)
nmap <SID>(command-line-enter) q:
xmap <SID>(command-line-enter) q:
autocmd VimrcAutoCmd CmdwinEnter * call s:init_cmdwin() "{{{
function! s:init_cmdwin()
set nonumber
set norelativenumber

nnoremap <buffer> q :<C-u>quit<CR>
nnoremap <buffer> <TAB> :<C-u>quit<CR>
nnoremap <buffer> <CR> <CR>
inoremap <buffer><expr><CR> pumvisible() ? "\<C-y>\<CR>" : "\<CR>"
inoremap <buffer><expr><C-h> pumvisible() ? "\<C-y>\<C-h>" : "\<C-h>"
inoremap <buffer><expr><BS> pumvisible() ? "\<C-y>\<C-h>" : "\<C-h>"
inoremap <buffer><expr> <CR> pumvisible() ? "\<C-y>\<CR>" : "\<CR>"
inoremap <buffer><expr> <C-h> pumvisible() ? "\<C-y>\<C-h>" : "\<C-h>"
inoremap <buffer><expr> <BS> pumvisible() ? "\<C-y>\<C-h>" : "\<C-h>"
inoremap <buffer> qq <Esc>:<C-u>quit<CR>
inoremap <buffer> kk <Esc>k
" Completion.
inoremap <buffer><expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <buffer><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
call altercmd#define('b', 'gr[ep]', 'Grep', 'i')

Expand All @@ -131,45 +125,13 @@ function! s:CSVH(x) "{{{
execute 'normal ^'.a:x.'f,'
endfunction "}}}

" autoloader of .vimrc {{{
if !has('gui_running') && !(has('win32') || has('win64'))
autocmd VimrcAutoCmd BufWritePost $MYVIMRC nested source $MYVIMRC
else
autocmd VimrcAutoCmd BufWritePost $MYVIMRC source $MYVIMRC |
\ if has('gui_running') | source $MYGVIMRC
autocmd VimrcAutoCmd BufWritePost $MYGVIMRC
\ if has('gui_running') | source $MYGVIMRC
endif
"}}}

" Open junk file. {{{
nmap <Leader>\ <SID>(open-junk-file)
nnoremap <SID>(open-junk-file) :<C-u>JunkFile<CR>
command! -nargs=0 JunkFile call s:open_junk_file()
function! s:open_junk_file() "{{{
let l:junk_dir = $HOME . '/.vim_junk'. strftime('/%Y/%m')
if !isdirectory(l:junk_dir)
call mkdir(l:junk_dir, 'p')
endif

let l:filename = input('Junk Code: ', l:junk_dir.strftime('/%Y-%m-%d-%H%M%S.'))
if l:filename != ''
execute 'edit ' . l:filename
endif
endfunction "}}}
"}}}

" matchit
runtime macros/matchit.vim

" search from current word
nnoremap * *N
nnoremap # #N
" revisual after indenting action
vnoremap > >gv
vnoremap < <gv
" clear highlightsearch
nnoremap <C-l> :nohlsearch<CR><C-l>
Expand Down
12 changes: 0 additions & 12 deletions vim/profiles/default.vim
Expand Up @@ -33,10 +33,6 @@ set virtualedit+=block
inoremap <C-u> <C-g>u<C-u>
inoremap <C-w> <C-g>u<C-w>
" Load .gvimrc after .vimrc edited at GVim.
nnoremap <silent> <Leader>lv :<C-u>source $MYVIMRC \| if has('gui_running') \| source $MYGVIMRC \| endif <CR>
nnoremap <silent> <Leader>lg :<C-u>source $MYGVIMRC<CR>
" create swp data to only tmp directory
set directory&
set directory-=.
Expand Down Expand Up @@ -104,14 +100,6 @@ set completeopt=menuone,preview
" completion targets
set complete=.,w,b,u,t,i

" set file type (setf) {{{
augroup FileTypeCmd
autocmd!
augroup END
autocmd FileTypeCmd FileType js setlocal ft=javascript
autocmd FileTypeCmd FileType pl setlocal ft=perl
"}}}

" encoding settings {{{
set encoding=utf-8
set fileencodings=utf-8,iso-2022-jp-3,iso-2022-jp,euc-jisx0213,euc-jp,ucs-bom,euc-jp,eucjp-ms,cp932
Expand Down
36 changes: 0 additions & 36 deletions vim/profiles/functions.vim

This file was deleted.

0 comments on commit e0d0c9b

Please sign in to comment.