This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:unite_source_file_mru_ignore_pattern = '' | |
let g:unite_source_file_mru_ignore_pattern .= '\~$' | |
let g:unite_source_file_mru_ignore_pattern .= '\|\.\%(o\|exe\|dll\|bak\|sw[po]\)$' | |
let g:unite_source_file_mru_ignore_pattern .= '\|\%(^\|/\)\.\%(hg\|git\|bzr\|svn\)\%($\|/\)' | |
let g:unite_source_file_mru_ignore_pattern .= '\|^\%(\\\\\|/mnt/\|/media/\|/Volumes/\)' | |
let g:unite_source_file_mru_ignore_pattern .= '\|AppData/Local/Temp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap [Option] <Nop> | |
nmap xo [Option] | |
nnoremap <silent>[Option]n :<C-u>call <SID>ToggleOption('number')<CR> | |
nnoremap <silent>[Option]w :<C-u>call <SID>ToggleOption('wrap')<CR> | |
nnoremap <silent>[Option]/ :<C-u>call <SID>ToggleOption('wrapscan')<CR> | |
function! s:ToggleOption(option) | |
if has_key(g:toggle_option_extra, a:option) | |
for e in g:toggle_option_extra[a:option] | |
if exists('+' . e) && eval("&" . e) == 0 | |
execute 'setlocal' e . '!' e . '?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap xU :<C-u>call <SID>DropUndoInfo()<CR> | |
function! s:DropUndoInfo() | |
if &modified | |
echoerr "This buffer has been modified!" | |
return | |
endif | |
let l:old_undolevels = &undolevels | |
set undolevels=-1 | |
execute "normal! aa\<BS>\<ESC>" | |
let &modified = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iabbrev *datetime* <C-r>=strftime("%Y/%m/%d %H:%M:%S")<CR><C-R>=<SID>Eatchar('\s')<CR> | |
iabbrev *date* <C-r>=strftime("%Y/%m/%d")<CR><C-R>=<SID>Eatchar('\s')<CR> | |
iabbrev *time* <C-r>=strftime("%H:%M:%S")<CR><C-R>=<SID>Eatchar('\s')<CR> | |
function! s:Eatchar(pattern) | |
let l:c = nr2char(getchar(0)) | |
return (l:c =~ a:pattern) ? '' : l:c | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <silent>xl :<C-u>call <SID>MakeOrderedList()<CR> | |
function! s:MakeOrderedList() | |
let l:count = v:count | |
normal! i1. | |
if l:count > 1 | |
let @l = 'yyp' | |
execute 'normal!' (l:count - 1) . '@l' | |
endif | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd MyAutoCmd GUIEnter * set guitablabel=%t%{GetTabModified()}\ [b:%{GetBufferTabLength()}] | |
function! GetTabModified() | |
for bufnr in tabpagebuflist(v:lnum) | |
if getbufvar(bufnr, "&modified") | |
return ' [+]' | |
endif | |
endfor | |
return '' | |
endfunction | |
function! GetBufferTabLength() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map x/ <Plug>(operator-search) | |
call operator#user#define('search', 'OperatorSearch') | |
function! OperatorSearch(motion_wise) | |
if a:motion_wise == 'char' | |
execute 'silent normal! `[v`]"zy' | |
call search(@z) | |
let @/ = @z | |
set hlsearch | |
endif | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !exists('g:auto_lcd') | |
let g:auto_lcd = 1 | |
endif | |
autocmd MyAutoCmd BufEnter * if g:auto_lcd | execute "lcd " . expand("%:p:h") | endif | |
command! -nargs=0 ToggleAutoLcd call <SID>ToggleAutoLcd() | |
function! s:ToggleAutoLcd() | |
lcd %:p:h | |
let g:auto_lcd = !g:auto_lcd | |
if g:auto_lcd | |
echo 'set autolcd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT | |
class.relname | |
FROM | |
pg_attribute AS att | |
INNER JOIN pg_class AS class | |
ON class.oid = att.attrelid | |
WHERE | |
att.attnum > 0 | |
AND att.attname = 'user_id' | |
AND class.relkind = 'r' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <silent>[Mark]m :<C-u>call <SID>AutoMark()<CR> | |
if !exists('g:marks_pos') | |
let g:marks_char = [ | |
\ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', | |
\ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' | |
\ ] | |
endif | |
function! s:AutoMark() | |
if !exists('b:marks_current_pos') || (b:marks_current_pos == len(g:marks_char) - 1) | |
let b:marks_current_pos = 0 |
OlderNewer