View init.vim
augroup startup
autocmd!
autocmd VimEnter * call PreventNestedNeovim()
augroup END
function! PreventNestedNeovim()
if !empty($NVIM_LISTEN_ADDRESS) && $NVIM_LISTEN_ADDRESS !=# v:servername
let g:r=sockconnect('pipe', $NVIM_LISTEN_ADDRESS, {'rpc':v:true})
let g:f=fnameescape(expand('%:p'))
noautocmd bwipe
View Rakefile
require 'rake'
require 'rake/clean'
task :default => :pdf
task :pdf => "book-draft1.pdf"
file "book-draft1.tex" => "book-draft1.md" do
sh "pandoc book-draft1.md -s -o book-draft1.tex"
end
View .projections.json
{
"*.js": {
"indent": "tabs:3"
}
}
View navcmd-abbrev.vim
function! SetupCommandAlias(input, output)
exec 'cabbrev <expr> '.a:input
\ .' ((getcmdtype() is# ":" && getcmdline() is# "'.a:input.'")'
\ .'? ("'.a:output.'") : ("'.a:input.'"))'
endfunction
call SetupCommandAlias("Em", "Emodel")
call SetupCommandAlias("Etm", "EmodelTest")
View ember-templates-projections.json
{
"app/routes/*.js": {
"type": "route",
"alternate": "app/templates/{}.hbs"
},
"app/templates/*.hbs": {
"type": "controllerTemplate",
"alternate": "app/controllers/{}.js"
},
"app/controllers/*.js": {
View gist:679c819db27b1f38ee549b480471c0bc
if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
alias nvim='echo "No nesting!"'
fi
View fix-stuff-up.vim
%s/}\ \\label/}\\label/ge
%s/\ \\ref/\~\\ref/ge
%s/\ "/\ ``/ge
%s/"\ /''\ /ge
%s/",/'',/ge
%s/"\./''\./ge
%s/")/'')/ge
%s/i\.e\.\ /i\.e\.\\\ /ge
View user-funcs.vim
function! MyFunction()
%s/ch/cx/ge
endfunction
" You can call the function as:
" :call MyFunction()
command! MyCommand call MyFunction()
" You can call the command as:
" :MyCommand
View control-r-in-terminal-mode.vim
if has('nvim')
tnoremap <expr> <C-R> '<C-\><C-N>"'.nr2char(getchar()).'pi'
tnoremap <C-v><C-r> <C-r>
endif
View escape-in-terminal-mode.vim
if has('nvim')
tnoremap <Esc> <C-\><C-n>
tnoremap <C-v><Esc> <Esc>
endif