itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

E117: Unknown function: calendar#new #52

Closed Enrico68 closed 10 years ago

Enrico68 commented 10 years ago

Hello,

I would like to try this plugin but when I try the Calendar command I have this error

itchyny commented 10 years ago

What's your Vim's version?

Enrico68 commented 10 years ago

7.4

itchyny commented 10 years ago

Which plugin manager do you use? And please provide the minimal configuration and how to produce the error. Otherwise, I cannot guess what's happening on your Vim and cannot fix.

itchyny commented 10 years ago

This plugin conflicts with mattn's calendar-vim. Removing that plugin resolves this problem.

Enrico68 commented 10 years ago

I am not using the mattn/calendar-vim plugin

Enrico68 commented 10 years ago

This is my .vimrc

" Setup language {{{ ==========================================================

language en_US.UTF-8 " Solve some plugins incompatibilities

" }}}

" NEOBUNDLE {{{ ===============================================================

set nocompatible " No to the total compatibility with the ancient vi

" NeoBundle auto-installation and setup {{{

" Auto installing NeoBundle let iCanHazNeoBundle=1 let neobundle_readme=expand($HOME.'/.vim/bundle/neobundle.vim/README.md') if !filereadable(neobundle_readme) echo "Installing NeoBundle.." echo "" silent !mkdir -p $HOME/.vim/bundle silent !git clone https://github.com/Shougo/neobundle.vim $HOME/.vim/bundle/neobundle.vim let iCanHazNeoBundle=0 endif

" Call NeoBundle if has('vim_starting') set rtp+=$HOME/.vim/bundle/neobundle.vim/ endif call neobundle#rc(expand($HOME.'/.vim/bundle/'))

" is better if NeoBundle rules NeoBundle (needed!) NeoBundle 'Shougo/neobundle.vim' " }}}

" BUNDLES (plugins administrated by NeoBundle) {{{

" Shougo's way {{{

" Vimproc to asynchronously run commands (NeoBundle, Unite) NeoBundle 'Shougo/vimproc', { \ 'build' : { \ 'windows' : 'make -f make_mingw32.mak', \ 'cygwin' : 'make -f make_cygwin.mak', \ 'mac' : 'make -f make_mac.mak', \ 'unix' : 'make -f make_unix.mak', \ }, \ }

" Unite. The interface to rule almost everything NeoBundle 'Shougo/unite.vim'

" Unite sources NeoBundleLazy 'Shougo/unite-outline', {'autoload':{'unite_sources':'outline'}} NeoBundleLazy 'tsukkee/unite-help', {'autoload':{'unite_sources':'help'}} NeoBundleLazy 'ujihisa/unite-colorscheme', {'autoload':{'unite_sources': \ 'colorscheme'}} NeoBundleLazy 'ujihisa/unite-locate', {'autoload':{'unite_sources':'locate'}} NeoBundleLazy 'thinca/vim-unite-history', { 'autoload' : { 'unite_sources' : \ ['history/command', 'history/search']}} NeoBundleLazy 'osyo-manga/unite-filetype', { 'autoload' : {'unite_sources' : \ 'filetype', }} NeoBundleLazy 'osyo-manga/unite-quickfix', {'autoload':{'unite_sources': \ ['quickfix', 'location_list']}} NeoBundleLazy 'osyo-manga/unite-fold', {'autoload':{'unite_sources':'fold'}} NeoBundleLazy 'tacroe/unite-mark', {'autoload':{'unite_sources':'mark'}} NeoBundleLazy 'Shougo/neomru.vim', {'autoload':{'unite_sources': ['file_mru', 'directory_mru']}}

" File explorer (needed where ranger is not available) NeoBundleLazy 'Shougo/vimfiler', {'autoload' : { 'commands' : ['VimFiler']}}

" Junk files NeoBundleLazy 'Shougo/junkfile.vim', {'autoload':{'commands':'JunkfileOpen', \ 'unite_sources':['junkfile','junkfile/new']}}

" Unite plugin that provides command line completition NeoBundle 'majkinetor/unite-cmdmatch'

" Unite plugin that provides spell suggestions NeoBundle 'kopischke/unite-spell-suggest' " }}}

" Colorschemes {{{

" Dark themes

NeoBundle 'tomasr/molokai' NeoBundleLazy 'sjl/badwolf', { 'autoload' : \ { 'unite_sources' : 'colorscheme', }} NeoBundleLazy 'nielsmadan/harlequin', { 'autoload' : \ { 'unite_sources' : 'colorscheme', }}

" Light themes NeoBundleLazy 'vim-scripts/summerfruit256.vim', { 'autoload' : \ { 'unite_sources' : 'colorscheme', }}

" Make terminal themes from GUI themes NeoBundleLazy 'godlygeek/csapprox', { 'autoload' : \ { 'commands' : ['CSApprox', 'CSApproxSnapshot']}}

" }}}

" DCVS {{{ " " Admin Git NeoBundle 'tpope/vim-fugitive' " Show git repository changes in the current file NeoBundle 'airblade/vim-gitgutter' " Git viewer NeoBundleLazy 'gregsexton/gitv', {'depends':['tpope/vim-fugitive'], \ 'autoload':{'commands':'Gitv'}}

" }}}

" reStructuredText {{{

" reStructuredText in vim. Your personal Wiki in RST NeoBundle 'Rykka/riv.vim', {'autoload': {'filetypes': ['rst']}}

" }}}

" Linux tools {{{

" Hexadecimal editor "NeoBundle 'Shougo/vinarise.vim'

" }}}

" Python {{{

" Autocompletion NeoBundle 'Shougo/neocomplete.vim' " A Python plugin NeoBundleLazy 'klen/python-mode', {'autoload': {'filetypes': ['python']}} " Admin virtualenvs NeoBundle 'jmcantrell/vim-virtualenv' " Show indent lines NeoBundleLazy 'Yggdroot/indentLine', {'autoload': {'filetypes': ['python']}} " Show reports from coverage.py NeoBundleLazy 'alfredodeza/coveragepy.vim', {'autoload': {'filetypes': ['python']}} " Sort imports NeoBundle 'fisadev/vim-isort', {'autoload': {'filetypes': ['python']}} " }}}

" Code Snippets {{{

" Powerful and advanced Snippets tool NeoBundle 'SirVer/ultisnips' " Snippets for Ultisnips NeoBundle 'honza/vim-snippets'

" }}}

" Syntax {{{

NeoBundleLazy 'elzr/vim-json', {'filetypes' : 'json'} NeoBundleLazy 'vim-scripts/po.vim--gray', {'autoload': {'filetypes': ['po']}} NeoBundle 'scrooloose/syntastic'

" }}}

" Open external links {{{

" Open a url into the browser or another files with an external app NeoBundle 'vim-scripts/utl.vim'

" }}}

" Text edition {{{

" Autocompletion of (, [, {, ', ", ... NeoBundle 'delimitMate.vim' " Smart and fast date changer NeoBundle 'tpope/vim-speeddating' " to surround vim objects with a pair of identical chars NeoBundle 'tpope/vim-surround' " extend repetitions by the 'dot' key NeoBundle 'tpope/vim-repeat' " toggle comments NeoBundle 'tpope/vim-commentary' " smart digraphs insertion NeoBundle 'Rykka/easydigraph.vim' " browse the vim undo tree NeoBundleLazy 'sjl/gundo.vim', { 'autoload' : {'commands': 'GundoToggle'}} " to insert lorem ipsum blocks NeoBundleLazy 'vim-scripts/loremipsum', { 'autoload' : \ { 'commands' : 'Loremipsum'}} " reveals all the character info, Unicode included NeoBundle 'tpope/vim-characterize' " transpose lines and text blocks NeoBundleLazy 'salsifis/vim-transpose', { 'autoload' : \ { 'commands' : 'Transpose'}} " marks admin NeoBundle 'kshenoy/vim-signature' " text-objects NeoBundle 'kana/vim-textobj-entire' " ae, ie NeoBundle 'kana/vim-textobj-indent' " ai, ii, aI, iI NeoBundle 'kana/vim-textobj-lastpat' " a/, i/, a?, i? NeoBundle 'kana/vim-textobj-line' " al, il NeoBundle 'kana/vim-textobj-underscore' " a, i NeoBundle 'kana/vim-textobj-user'

" }}}

" HTML/CSS {{{

" A smart and powerful Color Management tool. Needs to be loaded to be able " to use the mappings NeoBundleLazy 'Rykka/colorv.vim', {'autoload' : { \ 'commands' : [ \ 'ColorV', 'ColorVView', 'ColorVPreview', \ 'ColorVPicker', 'ColorVEdit', 'ColorVEditAll', \ 'ColorVInsert', 'ColorVList', 'ColorVName', \ 'ColorVScheme', 'ColorVSchemeFav', \ 'ColorVSchemeNew', 'ColorVTurn2'], \ }}

NeoBundleLazy 'othree/html5.vim', {'autoload': \ {'filetypes': ['html', 'xhttml', 'css']}}

NeoBundleLazy 'mattn/emmet-vim', {'autoload': \ {'filetypes': ['html', 'xhttml', 'css', 'xml', 'xls', 'markdown']}}

NeoBundle 'kchmck/vim-coffee-script',{'autoload' : { \ 'commands' : [ \ 'CoffeeCompile', 'CoffeeLint', 'CoffeeMake', \ 'CoffeeRun', 'CoffeeWatch'], \ 'filetypes' : ['coffee'] \ }}

" }}}

" GUI {{{

" A better looking status line NeoBundle 'bling/vim-airline' " Zooms a window NeoBundleLazy 'vim-scripts/zoomwintab.vim', {'autoload' : {'commands' : 'ZoomWinTabToggle'}} " easily window resizing NeoBundle 'jimsei/winresizer'

" }}}

" Tmux {{{

" Easily interacts with Tmux from Vim NeoBundle 'benmills/vimux' " Tmux config file syntax NeoBundleLazy 'vimez/vim-tmux', { 'autoload' : { 'filetypes' : 'conf'}}

" }}}

" API Web {{{

NeoBundle 'mattn/webapi-vim'

" }}}

" DBMS {{{

NeoBundle 'collinpeters/dbext.vim' " Mirror of http://www.vim.org/scripts/script.php?script_id=356

" }}}

" More Plugins!! {{{

"NeoBundle 'plasticboy/vim-markdown' " Markdown Vim Mode
NeoBundle 'vim-voom/VOoM' " Vim outliner for vim NeoBundle 'godlygeek/tabular' " Vim script for text filtering and alignment NeoBundle 'mhinz/vim-startify' "It does 3 things that will be explained in detail further below NeoBundle 'farseer90718/vim-taskwarrior' " vim interface for taskwarrior NeoBundle 'vim-scripts/TranslateIt' "Translate a word looking at dictionary stardict NeoBundle 'chusiang/vim-sdcv' "Traslate a word NeoBundle 'gerw/vim-latex-suite' NeoBundle 'Align' " 27/31 Help folks to align text, eqns, declarations, tables, etc NeoBundle 'goonzoid/vim-reprocessed' " A vim plugin for working with the Processing programming language NeoBundle 'vim-pandoc/vim-pandoc' " a plugin for writing in pandoc's extended markdown NeoBundle 'vim-pandoc/vim-pandoc-after' NeoBundle 'vim-pandoc/vim-pandoc-syntax' " pandoc markdown syntax, to be installed alongside vim-pandoc NeoBundle 'MarcWeber/vim-addon-mw-utils' " vim: interpret a file by function and cache file automatically NeoBundle 'CRefVim' " 1.0.0 a C-reference manual especially designed for Vim NeoBundle 'hari-rangarajan/CCTree' " Vim CCTree plugin NeoBundle 'vim-scripts/restore_view.vim' " A plugin for automatically restoring file's cursor position and folding NeoBundle 'xuhdev/SingleCompile' " A Vim plugin making it more convenient to compile or run a single source file. NeoBundle 'UncleBill/google.vim' " A vim plugin for google searching, providing suggestion completion. NeoBundle 'daisuzu/translategoogle.vim' " Vim interface for translate.google.com NeoBundle 'Lokaltog/vim-easymotion' " Vim motions on speed! NeoBundle 'wannesm/wmgraphviz.vim' " Vim plugin for Graphviz NeoBundle 'vim-scripts/vim-auto-save' " Automatically save changes to disk NeoBundle 'lambdalisue/vim-pandoc-preview' NeoBundle 'mattn/webapi-vim' " vim interface to Web API NeoBundle 'lynnard/pandoc-preview.vim' NeoBundle 'lambdalisue/shareboard.vim' " A HTML viewer built for vim. Useful to see output of Pandoc or Markdown NeoBundle 'vim-scripts/vimoutliner-colorscheme-fix' " Allows VimOutliner files to work with any colorscheme. NeoBundle 'vim-scripts/ag.vim' " Use ag, the_silver_searcher (better than ack, which is better than grep) NeoBundle 'Rykka/InstantRst' NeoBundle 'xolox/vim-notes' " Easy note taking in Vim NeoBundle 'xolox/vim-misc' " Miscellaneous auto-load Vim scripts NeoBundle 'mattn/calendar-vim' " calendar vimscript NeoBundle 'dhruvasagar/vim-table-mode' " VIM Table Mode for instant table creation. NeoBundle 'csv.vim' " 0.3 A Filetype plugin for csv files. NeoBundle 'itchyny/calendar.vim' " A calendar application for Vim let g:pandoc_preview_pdf_cmd = "evince" " END BUNDLES }}}

" Auto install the plugins {{{

" First-time plugins installation if iCanHazNeoBundle == 0 echo "Installing Bundles, please ignore key map error messages" echo "" :NeoBundleInstall endif

" Check if all of the plugins are already installed, in other case ask if we " want to install them (useful to add plugins in the .vimrc) NeoBundleCheck

" }}}

filetype plugin indent on " Indent and plugins by filetype

" END NEOBUNDLE }}}

" VIM Setup {{{ ===============================================================

" & mapping {{{

let mapleader=',' let maplocalleader= ' '

" }}}

" Basic options {{{

scriptencoding utf-8 set encoding=utf-8 " setup the encoding to UTF-8 set ls=2 " status line always visible set go-=T " hide the toolbar set go-=m " hide the menu " The next two lines are quite tricky, but in Gvim, if you don't do this, if you " only hide all the scrollbars, the vertical scrollbar is showed anyway set go+=rRlLbh " show all the scrollbars set go-=rRlLbh " hide all the scrollbars set visualbell " turn on the visual bell set cursorline " highlight the line under the cursor set fillchars+=vert:│ " better looking for windows separator set ttyfast " better screen redraw set title " set the terminal title to the current file set showcmd " shows partial commands set hidden " hide the inactive buffers set ruler " sets a permanent rule set lazyredraw " only redraws if it is needed set autoread " update a open file edited outside of Vim set ttimeoutlen=0 " toggle between modes almost instantly set backspace=indent,eol,start " defines the backspace key behavior set virtualedit=all " to edit where there is no actual character

" }}}

" Searching {{{

set incsearch " incremental searching set showmatch " show pairs match set hlsearch " highlight search results set smartcase " smart case ignore set ignorecase " ignore case letters

" }}}

" History and permanent undo levels {{{

set history=1000 set undofile set undoreload=1000

" }}}

" Make a dir if no exists {{{

function! MakeDirIfNoExists(path) if !isdirectory(expand(a:path)) call mkdir(expand(a:path), "p") endif endfunction

" }}}

" Backups {{{

set backup set noswapfile set backupdir=$HOME/.vim/tmp/backup/ set undodir=$HOME/.vim/tmp/undo/ set directory=$HOME/.vim/tmp/swap/ set viminfo+=n$HOME/.vim/tmp/viminfo

" make this dirs if no exists previously silent! call MakeDirIfNoExists(&undodir) silent! call MakeDirIfNoExists(&backupdir) silent! call MakeDirIfNoExists(&directory)

" }}}

" Wildmenu {{{

set wildmenu " Command line autocompletion set wildmode=list:longest,full " Shows all the options

set wildignore+=.sw? " Vim swap files set wildignore+=.bak,.?~,.??~,.???~,.~ " Backup files set wildignore+=.luac " Lua byte code set wildignore+=.jar " java archives set wildignore+=.pyc " Python byte code set wildignore+=.stats " Pylint stats

" }}}

" Tabs, space and wrapping {{{

set expandtab " spaces instead of tabs set tabstop=4 " a tab = four spaces set shiftwidth=4 " number of spaces for auto-indent set softtabstop=4 " a soft-tab of four spaces set autoindent " set on the auto-indent

" set formatoptions=qrn1ct set textwidth=80 set colorcolumn=81

function! ToggleWrap() let s:nowrap_cc_bg = [22, '#005f00'] redir => s:curr_cc_hi silent hi ColorColumn redir END let s:curr_cc_ctermbg = matchstr(s:curr_cc_hi, 'ctermbg=\zs.{-}\s\ze\1') let s:curr_cc_guibg = matchstr(s:curr_cchi, 'guibg=\zs.{-}$\ze\1') if s:curr_cc_ctermbg != s:nowrap_cc_bg[0] let g:curr_cc_ctermbg = s:curr_cc_ctermbg endif if s:curr_cc_guibg != s:nowrap_cc_bg[1] let g:curr_cc_guibg = s:curr_cc_guibg endif if &textwidth == 80 set textwidth=0 exec 'hi ColorColumn ctermbg='.s:nowrap_cc_bg[0]. \' guibg='.s:nowrap_cc_bg[1] elseif &textwidth == 0 set textwidth=80 exec 'hi ColorColumn ctermbg='.g:curr_cc_ctermbg. \' guibg='.g:curr_cc_guibg endif endfunction

nmap ew :call ToggleWrap()

" }}}

" Ok, a vim for men, get off the cursor keys {{{

nnoremap nnoremap nnoremap nnoremap inoremap inoremap inoremap inoremap

" }}}

" Colorscheme {{{

syntax enable " enable the syntax highlight set background=dark " set a dark background set t_Co=256 " 256 colors for the terminal if has('gui_running') colorscheme darkblue else colorscheme darkblue endif

" }}}

" Font {{{

set guifont=Dejavu\ Sans\ Mono\ for\ Powerline\ 11

" }}}

" Resize the divisions if the Vim window size changes {{{

au VimResized * exe "normal! ="

" }}}

" New windows {{{

nnoremap à v nnoremap h s

" }}}

" Fast window moves {{{

nnoremap h nnoremap j nnoremap k nnoremap l

" }}}

" Fast window & buffer close and kill {{{

nnoremap k c nnoremap K :bd

" }}}

" Toggle line numbers {{{

nnoremap . :call ToggleRelativeAbsoluteNumber() function! ToggleRelativeAbsoluteNumber() if !&number && !&relativenumber set number set norelativenumber elseif &number && !&relativenumber set nonumber set relativenumber elseif !&number && &relativenumber set number set relativenumber elseif &number && &relativenumber set nonumber set norelativenumber endif endfunction

" }}}

" Show hidden chars {{{

nmap eh :set list! set listchars=tab:→\ ,eol:↵,trail:·,extends:↷,precedes:↶

" }}}

" Folding {{{

set foldmethod=marker

" Toggle folding

nnoremap \ za vnoremap \ za

" }}}

" Cut/Paste {{{

" to/from the clipboard map y "_y map p "_p

" toggle paste mode map P :set invpaste

" }}}

" Autoload configuration when this file changes ($MYVIMRC) {{{

autocmd! BufWritePost vimrc source %

" }}}

" Spelling {{{

" turn on the spell checking and set the Spanish language nmap ss :setlocal spell spelllang=it " turn on the spell checking and set the English language nmap se :setlocal spell spelllang=en " turn off the spell checking nmap so :setlocal nospell " jump to the next bad spell word nmap sn ]s " suggest words " nmap sp z= nmap sp :Unite spell_suggest " jump to the next bad spell word and suggests a correct one " nmap sc ]sz= nmap sc ]s :Unite spell_suggest " add word to the dictionary nmap sa zg " }}}

" Save as root {{{

cmap w!! w !sudo tee % >/dev/null:e!

" }}}

" Quick saving {{{

nmap w :update

" }}}

" Delete trailing whitespaces {{{

nmap et :let _s=@/:%s/\s+$//e:let @/=_s:nohl

" }}}

" Use Ranger as a file explorer {{{

fun! RangerChooser() exec "silent !ranger --choosefile=/tmp/chosenfile " . expand("%:p:h") if filereadable('/tmp/chosenfile') exec 'edit ' . system('cat /tmp/chosenfile') call system('rm /tmp/chosenfile') endif redraw! endfun map x :call RangerChooser() " }}}

" Toggle the Quickfix window {{{

function! s:QuickfixToggle() for i in range(1, winnr('$')) let bnum = winbufnr(i) if getbufvar(bnum, '&buftype') == 'quickfix' cclose lclose return endif endfor copen endfunction command! ToggleQuickfix call QuickfixToggle()

nnoremap q :ToggleQuickfix

" }}}

" Text statistics {{{

" get the total of lines, words, chars and bytes (and for the current position) map es g

" get the word frequency in the text function! WordFrequency() range let all = split(join(getline(a:firstline, a:lastline)), '\A+') let frequencies = {} for word in all let frequencies[word] = get(frequencies, word, 0) + 1 endfor let lst = [] for [key,value] in items(frequencies) call add(lst, value."\t".key."\n") endfor call sort(lst) echo join(lst) endfunction command! -range=% WordFrequency ,call WordFrequency() map ef :Unite output:WordFrequency

" }}}

" Count lines of code {{{

function! LinesOfCode() echo system('cloc --quiet '.bufname("%")) endfunction

"}}}

" Toggle the search results highlighting {{{

map eq :set invhlsearch

" }}}

" Move between Vim and Tmux windows {{{

if exists('$TMUX') function! TmuxOrSplitSwitch(wincmd, tmuxdir) let previous_winnr = winnr() execute "wincmd " . a:wincmd if previous_winnr == winnr() " The sleep and & gives time to get back to vim so tmux's focus tracking " can kick in and send us our ^[[O execute "silent !sh -c 'sleep 0.01; tmux select-pane -" . a:tmuxdir . "' &" redraw! endif endfunction let previous_title = substitute(system("tmux display-message -p '#{pane_title}'"), '\n', '', '') let &t_ti = "]2;vim\" . &t_ti let &t_te = "]2;". previous_title . "\" . &t_te nnoremap :call TmuxOrSplitSwitch('h', 'L') nnoremap :call TmuxOrSplitSwitch('j', 'D') nnoremap :call TmuxOrSplitSwitch('k', 'U') nnoremap :call TmuxOrSplitSwitch('l', 'R') else map h map j map k map l endif

" }}}

" Quick exiting without save {{{

nnoremap `` :qa!

" }}}

" Execution permissions by default to shebang (#!) files {{{

augroup shebang_chmod autocmd! autocmd BufNewFile * let b:brand_new_file = 1 autocmd BufWritePost * unlet! b:brand_new_file autocmd BufWritePre \ if exists('b:brand_new_file') | \ if getline(1) =~ '^#!' | \ let b:chmod_post = '+x' | \ endif | \ endif autocmd BufWritePost,FileWritePost \ if exists('b:chmod_post') && executable('chmod') | \ silent! execute '!chmod '.b:chmod_post.' ""' | \ unlet b:chmod_post | \ endif augroup END

" }}}

" Load matchit by default {{{

if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' runtime! macros/matchit.vim endif

" }}}

" Make the Y behavior similar to D & C {{{

nnoremap Y y$

" }}}

" END VIM SETUP }}}

" PLUGINS Setup {{{ ===========================================================

" Restore view {{{

set viewoptions=cursor,folds,slash,unix let g:skipview_files = ['*.vim']

" }}}

" Airline {{{

set noshowmode

let g:airline_theme='powerlineish' let g:airline_enable_branch=1 let g:airline_powerline_fonts=1 let g:airline_detect_whitespace = 1 let g:airline#extensions#hunks#non_zero_only = 1

let g:airline#extensions#tabline#enabled = 2 let g:airline#extensions#tabline#fnamemod = ':t' let g:airline#extensions#tabline#buffer_min_count = 1

" }}}

" CoffeeScript {{{

map rw :CoffeeWatch vert

" }}}

" ColorV {{{

let g:colorv_cache_file=$HOME.'/.vim/tmp/vim_colorv_cache' let g:colorv_cache_fav=$HOME.'/.vim/tmp/vim_colorv_cache_fav'

" }}}

" Commentary {{{ -------------------------------------------------------------

nmap c CommentaryLine xmap c Commentary

augroup plugin_commentary au! au FileType python setlocal commentstring=#%s au FileType htmldjango setlocal commentstring={#\ %s\ #} au FileType puppet setlocal commentstring=#\ %s au FileType xquery setlocal commentstring=(:\ %s\ :) augroup END

" }}}

" DBext {{{

let g:dbext_default_type = 'SQLITE' let g:dbext_default_user = "" let g:dbext_default_passwd = "" let g:dbext_default_display_cmd_line = 0 let g:dbext_default_prompt_for_parameters=0 let g:dbext_default_history_file = $HOME.'./vim/tmp/dbext_sql_history.txt'

" Mappings

let g:dbext_default_usermaps = 0 let g:dbext_map_or_cmd = 'cmd'

vnoremap Se :DBExecVisualSQL vnoremap St :DBSelectFromTable vnoremap Sdt :DBDescribeTable vnoremap Sdp :DBDescribeProcedure vnoremap Slt :DBListTable vnoremap Slp :DBListProcedure vnoremap Slv :DBListView vnoremap Slc :DBListColumn

nnoremap Se :DBExecSQLUnderCursor nnoremap SE :DBExecSQLTopX nnoremap Sea :1,$DBExecRangeSQL nnoremap Sel :.,.DBExecRangeSQL nnoremap Sep :'<,'>DBExecRangeSQL nnoremap St :DBSelectFromTable nnoremap ST :DBSelectFromTableTopX nnoremap Stw :DBSelectFromTableWithWhere nnoremap Sta :DBSelectFromTableAskName nnoremap Sd :DBDescribeTable nnoremap Sda :DBDescribeTableAskName nnoremap Sdp :DBDescribeProcedure nnoremap Sdpa :DBDescribeProcedureAskName nnoremap Slt :DBListTable nnoremap Slp :DBListProcedure nnoremap Slv :DBListView nnoremap Slc :DBListColumn nnoremap Svr :DBListVar nmap Sal :.,.DBVarRangeAssign nmap Saa :1,$DBVarRangeAssign nmap Sap :'<,'>DBVarRangeAssign xmap Sa :DBVarRangeAssign nnoremap Sh :DBHistory nnoremap So :DBOrientation nnoremap Sbp DBPromptForBufferParameters

" SQLite let g:dbext_default_SQLITE_bin = 'sqlite3' " let g:dbext_default_SQLITE_cmd_header = ".mode column\n.headers ON\n" " let g:dbext_default_SQLITE_cmd_terminator = ';' " let g:dbext_default_SQLITE_cmd_terminator = ';' " let g:dbext_default_SQLITE_extra = ''

" }}}

" delimitmate {{{

let delimitMate_expand_space = 1

" }}}

" easydigraph {{{

let g:EasyDigraph_nmap = 'dd'

" }}}

" Fugitive {{{

nnoremap gn :Unite output:echo\ system("git\ init") nnoremap gs :Gstatus nnoremap gw :Gwrite nnoremap go :Gread nnoremap gR :Gremove nnoremap gm :Gmove nnoremap gc :Gcommit nnoremap gd :Gdiff nnoremap gb :Gblame nnoremap gB :Gbrowse nnoremap gp :Git! push nnoremap gP :Git! pull nnoremap gi :Git! nnoremap ge :Gedit nnoremap gE :Gedit nnoremap gl :exe "silent Glog Unite -no-quit \ quickfix":redraw! nnoremap gL :exe "silent Glog -- Unite -no-quit \ quickfix":redraw! nnoremap gt :!tig:redraw! nnoremap gS :exe "silent !shipit":redraw! nnoremap gg :exe 'silent Ggrep -i '.input("Pattern: ")Unite \ quickfix -no-quit nnoremap ggm :exe 'silent Glog --grep='.input("Pattern: ").' \Unite -no-quit quickfix' nnoremap ggt :exe 'silent Glog -S='.input("Pattern: ").' \Unite -no-quit quickfix'

nnoremap ggc :silent! Ggrep -i

" for the diffmode noremap du :diffupdate

if !exists(":Gdiffoff") command Gdiffoff diffoff | q | Gedit endif noremap dq :Gdiffoff " }}}

" Gitv {{{

nnoremap gv :Gitv --all nnoremap gV :Gitv! --all vnoremap gV :Gitv! --all

let g:Gitv_OpenHorizontal = 'auto' let g:Gitv_WipeAllOnClose = 1 let g:Gitv_DoNotMapCtrlKey = 1 " let g:Gitv_WrapLines = 1

autocmd FileType git set nofoldenable

" }}}

" GitHub dashboard {{{

nnoremap gD :exe 'GHD! '.input("Username: ") nnoremap gA :exe 'GHA! '.input("Username or repository: ")

function! GHDashboard (...) if &filetype == 'github-dashboard' " first variable is the statusline builder let builder = a:1

call builder.add_section('airline_a', 'GitHub ')
call builder.add_section('airline_b',
            \ ' %{get(split(get(split(github_dashboard#statusline(), " "),
            \ 1, ""), ":"), 0, "")} ')
call builder.add_section('airline_c',
            \ ' %{get(split(get(split(github_dashboard#statusline(), " "),
            \ 2, ""), "]"), 0, "")} ')

" tell the core to use the contents of the builder
return 1

endif endfunction

autocmd FileType github-dashboard call airline#add_statusline_func('GHDashboard')

" }}}

" Gundo {{{ ------------------------------------------------------------------

nnoremap u :GundoToggle

let g:gundo_preview_bottom = 1

" }}}

" indentLine {{{

map L :IndentLinesToggle let g:indentLine_enabled = 0 let g:indentLine_char = '┊' let g:indentLine_color_term = 239

" }}}

" Neocomplete {{{

let g:neocomplete#enable_at_startup = 0 let g:neocomplete#enable_smart_case = 1 let g:neocomplete#enable_refresh_always = 1 let g:neocomplete#max_list = 30 let g:neocomplete#min_keyword_length = 1 let g:neocomplete#sources#syntax#min_keyword_length = 1 let g:neocomplete#data_directory = $HOME.'/.vim/tmp/neocomplete'

" disable the auto select feature by default to speed up writing without " obstacles (is optimal for certain situations) let g:neocomplete#enable_auto_select = 0

" toggle the auto select feature function! ToggleNeoComplete() if !g:neocomplete#disable_auto_complete && g:neocomplete#enable_auto_select let g:neocomplete#disable_auto_complete = 0 let g:neocomplete#enable_auto_select = 0 elseif !g:neocomplete#disable_auto_complete && !g:neocomplete#enable_auto_select let g:neocomplete#disable_auto_complete = 1 let g:neocomplete#enable_auto_select = 0 elseif g:neocomplete#disable_auto_complete && !g:neocomplete#enable_auto_select let g:neocomplete#disable_auto_complete = 0 let g:neocomplete#enable_auto_select = 1 endif endfunction nnoremap ea :call ToggleNeoComplete()

" Enable omni completion. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType html,markdown,pandoc setlocal omnifunc=htmlcomplete#CompleteTags autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

if !exists('g:neocomplete#sources#omni#input_patterns') let g:neocomplete#sources#omni#input_patterns = {} endif

let g:neocomplete#sources#omni#input_patterns.python='[^. \t].\w*'

" }}}

" Neobundle {{{

let g:neobundle#log_filename = $HOME.'/.vim/tmp/neobundle.log'

" }}}

" neomru {{{

let g:neomru#file_mru_path = $HOME.'/.vim/tmp/neomru/file' let g:neomru#directory_mru_path = $HOME.'/.vim/tmp/neomru/directory'

" }}}

" PythonMode {{{ -------------------------------------------------------------

nmap n :PymodeLint

let g:pymode_breakpoint_bind = 'B'

let g:pymode_lint = 1 let g:pymode_lint_on_write = 0 let g:pymode_lint_checkers = ['pylint', 'pep8', 'mccabe', 'pep257'] let g:pymode_lint_ignore = '' let g:pymode_virtualenv = 0 let g:pymode_rope = 1

let g:pymode_rope_completion = 0 let g:pymode_rope_complete_on_dot = 1

" }}}

" Syntastic {{{

nmap N :SyntasticCheck:Errors

let g:syntastic_python_pylint_exe = "pylint2" let g:syntastic_mode_map = { 'mode': 'active', \ 'active_filetypes': [], \ 'passive_filetypes': ['python'] }

let g:syntastic_error_symbol='✗' let g:syntastic_warning_symbol='⚠' let g:syntastic_style_error_symbol = '⚡' let g:syntastic_style_warning_symbol = '⚡'

" }}}

" Unite {{{

" files nnoremap o :Unite -silent -start-insert file nnoremap O :Unite -silent -start-insert file_rec/async nnoremap m :Unite -silent file_mru " buffers nnoremap b :Unite -silent buffer " tabs nnoremap B :Unite -silent tab " buffer search nnoremap f :Unite -silent -no-split -start-insert -auto-preview \ line nnoremap [menu]8 :UniteWithCursorWord -silent -no-split -auto-preview \ line " yankring nnoremap i :Unite -silent history/yank " grep nnoremap a :Unite -silent -no-quit grep " help nnoremap g :UniteWithCursorWord -silent help " tasks nnoremap ; :Unite -silent -toggle \ grep:%::FIXME|TODO|NOTE|XXX|COMBAK|@todo " outlines (also ctags) nnoremap t :Unite -silent -vertical -winwidth=40 \ -direction=topleft -toggle outline " junk files noremap d :Unite -silent junkfile/new junkfile

" menus {{{ let g:unite_source_menu_menus = {}

" menu prefix key (for all Unite menus) {{{ nnoremap [menu] nmap [menu] " }}}

" menus menu nnoremap [menu]u :Unite -silent -winheight=20 menu

" files and dirs menu {{{ let g:unite_source_menu_menus.files = { \ 'description' : ' files & dirs \ ⌘ [space]o', } let g:unite_source_menu_menus.files.command_candidates = [ ['▷ open file ⌘ ,o', \'Unite -start-insert file'], ['▷ open more recently used files ⌘ ,m', \'Unite file_mru'], ['▷ open file with recursive search ⌘ ,O', \'Unite -start-insert file_rec/async'], ['▷ edit new file', \'Unite file/new'], ['▷ search directory', \'Unite directory'], ['▷ search recently used directories', \'Unite directory_mru'], ['▷ search directory with recursive search', \'Unite directory_rec/async'], ['▷ make new directory', \'Unite directory/new'], ['▷ change working directory', \'Unite -default-action=lcd directory'], ['▷ know current working directory', \'Unite output:pwd'], ['▷ junk files ⌘ ,d', \'Unite junkfile/new junkfile'], ['▷ save as root ⌘ :w!!', \'exe "write !sudo tee % >/dev/null"'], ['▷ quick save ⌘ ,w', \'normal ,w'], ['▷ open ranger ⌘ ,x', \'call RangerChooser()'], ['▷ open vimfiler ⌘ ,X', \'VimFiler'], ] nnoremap [menu]o :Unite -silent -winheight=17 -start-insert \ menu:files " }}}

" file searching menu {{{ let g:unite_source_menu_menus.grep = { \ 'description' : ' search files \ ⌘ [space]a', } let g:unite_source_menu_menus.grep.command_candidates = [ ['▷ grep (ag → ack → grep) ⌘ ,a', \'Unite -no-quit grep'], ['▷ find', \'Unite find'], ['▷ locate', \'Unite -start-insert locate'], ['▷ vimgrep (very slow)', \'Unite vimgrep'], ] nnoremap [menu]a :Unite -silent menu:grep " }}}

" buffers, tabs & windows menu {{{ let g:unite_source_menu_menus.navigation = { \ 'description' : ' navigate by buffers, tabs & windows \ ⌘ [space]b', } let g:unite_source_menu_menus.navigation.command_candidates = [ ['▷ buffers ⌘ ,b', \'Unite buffer'], ['▷ tabs ⌘ ,B', \'Unite tab'], ['▷ windows', \'Unite window'], ['▷ location list', \'Unite location_list'], ['▷ quickfix', \'Unite quickfix'], ['▷ resize windows ⌘ C-C C-W', \'WinResizerStartResize'], ['▷ new vertical window ⌘ ,v', \'vsplit'], ['▷ new horizontal window ⌘ ,h', \'split'], ['▷ close current window ⌘ ,k', \'close'], ['▷ toggle quickfix window ⌘ ,q', \'normal ,q'], ['▷ zoom ⌘ ,z', \'ZoomWinTabToggle'], ['▷ delete buffer ⌘ ,K', \'bd'], ] nnoremap [menu]b :Unite -silent menu:navigation " }}}

" buffer internal searching menu {{{ let g:unite_source_menu_menus.searching = { \ 'description' : ' searchs inside the current buffer \ ⌘ [space]f', } let g:unite_source_menu_menus.searching.command_candidates = [ ['▷ search line ⌘ ,f', \'Unite -auto-preview -start-insert line'], ['▷ search word under the cursor ⌘ [space]8', \'UniteWithCursorWord -no-split -auto-preview line'], ['▷ search outlines & tags (ctags) ⌘ ,t', \'Unite -vertical -winwidth=40 -direction=topleft -toggle outline'], ['▷ search marks', \'Unite -auto-preview mark'], ['▷ search folds', \'Unite -vertical -winwidth=30 -auto-highlight fold'], ['▷ search changes', \'Unite change'], ['▷ search jumps', \'Unite jump'], ['▷ search undos', \'Unite undo'], ['▷ search tasks ⌘ ,;', \'Unite -toggle grep:%::FIXME|TODO|NOTE|XXX|COMBAK|@todo'], ] nnoremap [menu]f :Unite -silent menu:searching " }}}

" yanks, registers & history menu {{{ let g:unite_source_menu_menus.registers = { \ 'description' : ' yanks, registers & history \ ⌘ [space]i', } let g:unite_source_menu_menus.registers.command_candidates = [ ['▷ yanks ⌘ ,i', \'Unite history/yank'], ['▷ commands (history) ⌘ q:', \'Unite history/command'], ['▷ searches (history) ⌘ q/', \'Unite history/search'], ['▷ registers', \'Unite register'], ['▷ messages', \'Unite output:messages'], ['▷ undo tree (gundo) ⌘ ,u', \'GundoToggle'], ] nnoremap [menu]i :Unite -silent menu:registers " }}}

" spelling menu {{{ let g:unite_source_menu_menus.spelling = { \ 'description' : ' spell checking \ ⌘ [space]s', } let g:unite_source_menu_menus.spelling.command_candidates = [ ['▷ spell checking in Italian ⌘ ,ss', \'setlocal spell spelllang=it'], ['▷ spell checking in English ⌘ ,se', \'setlocal spell spelllang=en'], ['▷ turn off spell checking ⌘ ,so', \'setlocal nospell'], ['▷ jumps to next bad spell word and show suggestions ⌘ ,sc', \'normal ,sc'], ['▷ jumps to next bad spell word ⌘ ,sn', \'normal ,sn'], ['▷ suggestions ⌘ ,sp', \'normal ,sp'], ['▷ add word to dictionary ⌘ ,sa', \'normal ,sa'], ] nnoremap [menu]s :Unite -silent menu:spelling " }}}

" text edition menu {{{ let g:unite_source_menu_menus.text = { \ 'description' : ' text edition \ ⌘ [space]e', } let g:unite_source_menu_menus.text.command_candidates = [ ['▷ toggle search results highlight ⌘ ,eq', \'set invhlsearch'], ['▷ toggle line numbers ⌘ ,l', \'call ToggleRelativeAbsoluteNumber()'], ['▷ toggle wrapping ⌘ ,ew', \'call ToggleWrap()'], ['▷ toggle auto-completion state (manual → disabled → auto) ⌘ ,ea', \'call ToggleNeoCompleteAutoSelect()'], ['▷ show hidden chars ⌘ ,eh', \'set list!'], ['▷ toggle fold ⌘ /', \'normal za'], ['▷ open all folds ⌘ zR', \'normal zR'], ['▷ close all folds ⌘ zM', \'normal zM'], ['▷ copy to the clipboard ⌘ ,y', \'normal ,y'], ['▷ paste from the clipboard ⌘ ,p', \'normal ,p'], ['▷ toggle paste mode ⌘ ,P', \'normal ,P'], ['▷ remove trailing whitespaces ⌘ ,et', \'normal ,et'], ['▷ text statistics ⌘ ,es', \'Unite output:normal\ ,es -no-cursor-line'], ['▷ show word frequency ⌘ ,ef', \'Unite output:WordFrequency'], ['▷ show available digraphs', \'digraphs'], ['▷ insert lorem ipsum text', \'exe "Loremipsum" input("numero de palabras: ")'], ['▷ show current char info ⌘ ga', \'normal ga'], ] nnoremap [menu]e :Unite -silent -winheight=20 menu:text " }}}

" neobundle menu {{{ let g:unite_source_menu_menus.neobundle = { \ 'description' : ' plugins administration with neobundle \ ⌘ [space]n', } let g:unite_source_menu_menus.neobundle.command_candidates = [ ['▷ neobundle', \'Unite neobundle'], ['▷ neobundle log', \'Unite neobundle/log'], ['▷ neobundle lazy', \'Unite neobundle/lazy'], ['▷ neobundle update', \'Unite neobundle/update'], ['▷ neobundle search', \'Unite neobundle/search'], ['▷ neobundle install', \'Unite neobundle/install'], ['▷ neobundle check', \'Unite -no-empty output:NeoBundleCheck'], ['▷ neobundle docs', \'Unite output:NeoBundleDocs'], ['▷ neobundle clean', \'NeoBundleClean'], ['▷ neobundle rollback', \'exe "NeoBundleRollback" input("plugin: ")'], ['▷ neobundle list', \'Unite output:NeoBundleList'], ['▷ neobundle direct edit', \'NeoBundleExtraEdit'], ] nnoremap [menu]n :Unite -silent -start-insert menu:neobundle " }}}

" git menu {{{ let g:unite_source_menu_menus.git = { \ 'description' : ' admin git repositories \ ⌘ [space]g', } let g:unite_source_menu_menus.git.command_candidates = [ ['▷ tig ⌘ ,gt', \'normal ,gt'], ['▷ git viewer (gitv) ⌘ ,gv', \'normal ,gv'], ['▷ git viewer - buffer (gitv) ⌘ ,gV', \'normal ,gV'], ['▷ git status (fugitive) ⌘ ,gs', \'Gstatus'], ['▷ git diff (fugitive) ⌘ ,gd', \'Gdiff'], ['▷ git commit (fugitive) ⌘ ,gc', \'Gcommit'], ['▷ git log (fugitive) ⌘ ,gl', \'exe "silent Glog | Unite -no-quit quickfix"'], ['▷ git log - all (fugitive) ⌘ ,gL', \'exe "silent Glog -all | Unite -no-quit quickfix"'], ['▷ git blame (fugitive) ⌘ ,gb', \'Gblame'], ['▷ git add/stage (fugitive) ⌘ ,gw', \'Gwrite'], ['▷ git checkout (fugitive) ⌘ ,go', \'Gread'], ['▷ git rm (fugitive) ⌘ ,gR', \'Gremove'], ['▷ git mv (fugitive) ⌘ ,gm', \'exe "Gmove " input("destino: ")'], ['▷ git push (fugitive, buffer output) ⌘ ,gp', \'Git! push'], ['▷ git pull (fugitive, buffer output) ⌘ ,gP', \'Git! pull'], ['▷ git command (fugitive, buffer output) ⌘ ,gi', \'exe "Git! " input("comando git: ")'], ['▷ git edit (fugitive) ⌘ ,gE', \'exe "command Gedit " input(":Gedit ")'], ['▷ git grep (fugitive) ⌘ ,gg', \'exe "silent Ggrep -i ".input("Pattern: ") | Unite -no-quit quickfix'], ['▷ git grep - messages (fugitive) ⌘ ,ggm', \'exe "silent Glog --grep=".input("Pattern: ")." | Unite -no-quit quickfix"'], ['▷ git grep - text (fugitive) ⌘ ,ggt', \'exe "silent Glog -S".input("Pattern: ")." | Unite -no-quit quickfix"'], ['▷ git init ⌘ ,gn', \'Unite output:echo\ system("git\ init")'], ['▷ git cd (fugitive)', \'Gcd'], ['▷ git lcd (fugitive)', \'Glcd'], ['▷ git browse (fugitive) ⌘ ,gB', \'Gbrowse'], ['▷ github dashboard (github-dashboard) ⌘ ,gD', \'exe "GHD! " input("Username: ")'], ['▷ github activity (github-dashboard) ⌘ ,gA', \'exe "GHA! " input("Username or repository: ")'], ['▷ github issues & PR ⌘ ,gS', \'normal ,gS'], ] nnoremap [menu]g :Unite -silent -winheight=29 -start-insert menu:git " }}}

" code menu {{{ let g:unite_source_menu_menus.code = { \ 'description' : ' code tools \ ⌘ [space]p', } let g:unite_source_menu_menus.code.command_candidates = [ ['▷ run python code (pymode) ⌘ ,r', \'PymodeRun'], ['▷ show docs for the current word (pymode) ⌘ K', \'normal K'], ['▷ insert a breakpoint (pymode) ⌘ ,B', \'normal ,B'], ['▷ pylint check (pymode) ⌘ ,n', \'PymodeLint'], ['▷ run with python2 in tmux panel (vimux) ⌘ ,rr', \'normal ,rr'], ['▷ run with python3 in tmux panel (vimux) ⌘ ,r3', \'normal ,r3'], ['▷ run with python2 & time in tmux panel (vimux) ⌘ ,rt', \'normal ,rt'], ['▷ run with pypy & time in tmux panel (vimux) ⌘ ,rp', \'normal ,rp'], ['▷ command prompt to run in a tmux panel (vimux) ⌘ ,rc', \'VimuxPromptCommand'], ['▷ repeat last command (vimux) ⌘ ,rl', \'VimuxRunLastCommand'], ['▷ stop command execution in tmux panel (vimux) ⌘ ,rs', \'VimuxInterruptRunner'], ['▷ inspect tmux panel (vimux) ⌘ ,ri', \'VimuxInspectRunner'], ['▷ close tmux panel (vimux) ⌘ ,rq', \'VimuxCloseRunner'], ['▷ sort imports (isort)', \'Isort'], ['▷ go to definition (pymode-rope) ⌘ C-C g', \'call pymode#rope#goto_definition()'], ['▷ find where a function is used (pymode-rope) ⌘ C-C f', \'call pymode#rope#find_it()'], ['▷ show docs for current word (pymode-rope) ⌘ C-C d', \'call pymode#rope#show_doc()'], ['▷ reorganize imports (pymode-rope) ⌘ C-C r o', \'call pymode#rope#organize_imports()'], ['▷ refactorize - rename (pymode-rope) ⌘ C-C r r', \'call pymode#rope#rename()'], ['▷ refactorize - inline (pymode-rope) ⌘ C-C r i', \'call pymode#rope#inline()'], ['▷ refactorize - move (pymode-rope) ⌘ C-C r v', \'call pymode#rope#move()'], ['▷ refactorize - use function (pymode-rope) ⌘ C-C r u', \'call pymode#rope#use_function()'], ['▷ refactorize - change signature (pymode-rope) ⌘ C-C r s', \'call pymode#rope#signature()'], ['▷ refactorize - rename current module (pymode-rope) ⌘ C-C r 1 r', \'PymodeRopeRenameModule'], ['▷ refactorize - module to package (pymode-rope) ⌘ C-C r 1 p', \'PymodeRopeModuleToPackage'], ['▷ syntastic toggle (syntastic)', \'SyntasticToggleMode'], ['▷ syntastic check & errors (syntastic) ⌘ ,N', \'normal ,N'], ['▷ list virtualenvs (virtualenv)', \'Unite output:VirtualEnvList'], ['▷ activate virtualenv (virtualenv)', \'VirtualEnvActivate'], ['▷ deactivate virtualenv (virtualenv)', \'VirtualEnvDeactivate'], ['▷ run coverage2 (coveragepy)', \'call system("coverage2 run ".bufname("%")) | Coveragepy report'], ['▷ run coverage3 (coveragepy)', \'call system("coverage3 run ".bufname("%")) | Coveragepy report'], ['▷ toggle coverage report (coveragepy)', \'Coveragepy session'], ['▷ toggle coverage marks (coveragepy)', \'Coveragepy show'], ['▷ coffeewatch (coffeescript) ⌘ ,rw', \'CoffeeWatch vert'], ['▷ count lines of code', \'Unite -default-action= output:call\ LinesOfCode()'], ['▷ toggle indent lines ⌘ ,L', \'IndentLinesToggle'], ] nnoremap [menu]p :Unite -silent -winheight=42 menu:code " }}}

" markdown menu {{{ let g:unite_source_menu_menus.markdown = { \ 'description' : ' preview markdown extra docs \ ⌘ [space]k', } let g:unite_source_menu_menus.markdown.command_candidates = [ ['▷ preview', \'Me'], ['▷ refresh', \'Mer'], ] nnoremap [menu]k :Unite -silent menu:markdown " }}}

" reST menu {{{ let g:unite_source_menu_menus.rest = { \ 'description' : ' reStructuredText \ ⌘ [space]r', } let g:unite_source_menu_menus.rest.command_candidates = [ ['▷ CheatSheet', \'RivCheatSheet'], ['▷ reStructuredText Specification', \'RivSpecification'], ] nnoremap [menu]r :Unite -silent menu:rest " }}}

" bookmarks menu {{{ let g:unite_source_menu_menus.bookmarks = { \ 'description' : ' bookmarks \ ⌘ [space]m', } let g:unite_source_menu_menus.bookmarks.command_candidates = [ ['▷ open bookmarks', \'Unite bookmark:*'], ['▷ add bookmark', \'UniteBookmarkAdd'], ] nnoremap [menu]m :Unite -silent menu:bookmarks " }}}

" colorv menu {{{ function! GetColorFormat() let formats = {'r' : 'RGB', \'n' : 'NAME', \'s' : 'HEX', \'ar': 'RGBA', \'pr': 'RGBP', \'pa': 'RGBAP', \'m' : 'CMYK', \'l' : 'HSL', \'la' : 'HSLA', \'h' : 'HSV', } let formats_menu = ["\n"] for [k, v] in items(formats) call add(formats_menu, " ".k."\t".v."\n") endfor let fsel = get(formats, input('Choose a format: '.join(formats_menu).'? ')) return fsel endfunction

function! GetColorMethod() let methods = { \'h' : 'Hue', \'s' : 'Saturation', \'v' : 'Value', \'m' : 'Monochromatic', \'a' : 'Analogous', \'3' : 'Triadic', \'4' : 'Tetradic', \'n' : 'Neutral', \'c' : 'Clash', \'q' : 'Square', \'5' : 'Five-Tone', \'6' : 'Six-Tone', \'2' : 'Complementary', \'p' : 'Split-Complementary', \'l' : 'Luma', \'g' : 'Turn-To', } let methods_menu = ["\n"] for [k, v] in items(methods) call add(methods_menu, " ".k."\t".v."\n") endfor let msel = get(methods, input('Choose a method: '.join(methods_menu).'? ')) return msel endfunction

let g:unite_source_menu_menus.colorv = { \ 'description' : ' color management \ ⌘ [space]c', } let g:unite_source_menu_menus.colorv.command_candidates = [ ['▷ open colorv ⌘ ,cv', \'ColorV'], ['▷ open colorv with the color under the cursor ⌘ ,cw', \'ColorVView'], ['▷ preview colors ⌘ ,cpp', \'ColorVPreview'], ['▷ color picker ⌘ ,cd', \'ColorVPicker'], ['▷ edit the color under the cursor ⌘ ,ce', \'ColorVEdit'], ['▷ edit the color under the cursor (and all the concurrences) ⌘ ,cE', \'ColorVEditAll'], ['▷ insert a color ⌘ ,cii', \'exe "ColorVInsert " .GetColorFormat()'], ['▷ color list relative to the current ⌘ ,cgh', \'exe "ColorVList " .GetColorMethod() " \ ".input("number of colors? (optional): ") \ " ".input("number of steps? (optional): ")'], ['▷ show colors list (Web W3C colors) ⌘ ,cn', \'ColorVName'], ['▷ choose color scheme (ColourLovers, Kuler) ⌘ ,css', \'ColorVScheme'], ['▷ show favorite color schemes ⌘ ,csf', \'ColorVSchemeFav'], ['▷ new color scheme ⌘ ,csn', \'ColorVSchemeNew'], ['▷ create hue gradation between two colors', \'exe "ColorVTurn2 " " ".input("Color 1 (hex): ") \" ".input("Color 2 (hex): ")'], ] nnoremap [menu]c :Unite -silent menu:colorv " }}}

" vim menu {{{ let g:unite_source_menu_menus.vim = { \ 'description' : ' vim \ ⌘ [space]v', } let g:unite_source_menu_menus.vim.command_candidates = [ ['▷ choose colorscheme', \'Unite colorscheme -auto-preview'], ['▷ mappings', \'Unite mapping -start-insert'], ['▷ edit configuration file (vimrc)', \'edit $MYVIMRC'], ['▷ choose filetype', \'Unite -start-insert filetype'], ['▷ vim help', \'Unite -start-insert help'], ['▷ vim commands', \'Unite -start-insert command'], ['▷ vim functions', \'Unite -start-insert function'], ['▷ vim runtimepath', \'Unite -start-insert runtimepath'], ['▷ vim command output', \'Unite output'], ['▷ unite sources', \'Unite source'], ['▷ kill process', \'Unite -default-action=sigkill -start-insert process'], ['▷ launch executable (dmenu like)', \'Unite -start-insert launcher'], ] nnoremap [menu]v :Unite menu:vim -silent -start-insert " }}}

" db menu {{{ let g:unite_source_menu_menus.db = { \ 'description' : ' database (SQL) \ ⌘ [space]S', } let g:unite_source_menu_menus.db.command_candidates = [ ['▷ Execute SQL', \'exe "DBExecSQL" " ".input("SQL?: ")'], ['▷ Execute SQL (with limit of n rows)', \'exe "DBExecSQL" " ".input("SQL?: ")'], ['▷ SQL SELECT statement', \'exe "Select" " ".input("SELECT ")'], ['▷ SQL UPDATE statement', \'exe "Update" " ".input("UPDATE")'], ['▷ SQL INSERT statement', \'exe "Insert" " ".input("INSERT")'], ['▷ SQL DELETE statement', \'exe "Delete" " ".input("DELETE")'], ['▷ SQL CALL statement', \'exe "Call" " ".input("CALL")'], ['▷ SQL DROP statement', \'exe "Drop" " ".input("DROP")'], ['▷ SQL ALTER statement', \'exe "Alter" " ".input("ALTER")'], ['▷ SQL CREATE statement', \'exe "Create" " ".input("CREATE")'], ['▷ List all Tables ⌘ ,Slt', \'DBListTable'], ['▷ List all Procedures ⌘ ,Slp', \'DBListProcedure'], ['▷ List all Views ⌘ ,Slv', \'DBListView'], ['▷ List all Variables ⌘ ,Svr', \'DBListVar'], ['▷ DBext Get Options', \'DBGetOption'], ['▷ DBext Set Option', \'exe "DBSetOption" " ".input("Option: ")'], ['▷ DBext Set Var', \'exe "DBSetVar" " ".input("Var: ")'], ['▷ DBext Set Buffer Parameters', \'DBPromptForBufferParameters'], ['▷ List all Connections (only DBI/ODBC)', \'DBListConnections'], ['▷ Commit (only DBI/ODBC)', \'DBCommit'], ['▷ Rollback (only DBI/ODBC)', \'DBRollback'], ['▷ Connect (only DBI/ODBC)', \'DBConnect'], ['▷ Disconnect (only DBI/ODBC)', \'DBDisconnect'], ]

nnoremap [menu]S :Unite menu:db -silent -winheight=25 -start-insert

" }}}

" }}}

call unite#filters#matcher_default#use(['matcher_fuzzy']) call unite#filters#sorter_default#use(['sorter_rank']) call unite#custom#source('file_mru,file_rec,file_rec/async,grep,locate', \ 'ignore_pattern', join(['.git/', 'tmp/', 'bundle/'], '|'))

let g:unite_source_history_yank_enable = 1 let g:unite_enable_start_insert = 0 let g:unite_enable_short_source_mes = 0 let g:unite_force_overwrite_statusline = 0 let g:unite_prompt = '>>> ' let g:unite_marked_icon = '✓' " let g:unite_candidate_icon = '∘' let g:unite_winheight = 15 let g:unite_update_time = 200 let g:unite_split_rule = 'botright' let g:unite_data_directory = $HOME.'/.vim/tmp/unite' let g:unite_source_buffer_time_format = '(%d-%m-%Y %H:%M:%S) ' let g:unite_source_file_mru_time_format = '(%d-%m-%Y %H:%M:%S) ' let g:unite_source_directory_mru_time_format = '(%d-%m-%Y %H:%M:%S) '

if executable('ag') let g:unite_source_grep_command='ag' let g:unite_source_grep_default_opts='--nocolor --nogroup -a -S' let g:unite_source_grep_recursive_opt='' let g:unite_source_grep_search_word_highlight = 1 elseif executable('ack') let g:unite_source_grep_command='ack' let g:unite_source_grep_default_opts='--no-group --no-color' let g:unite_source_grep_recursive_opt='' let g:unite_source_grep_search_word_highlight = 1 endif

let g:junkfile#directory=expand($HOME."/.vim/tmp/junk")

" }}}

" Utl {{{

map j :Utl :redraw!

let g:utl_cfg_hdl_scm_http_system = "silent !chromium-browser %u &" let g:utl_cfg_hdl_mt_application_pdf = 'silent :!evince %p &' let g:utl_cfg_hdl_mt_image_jpeg = 'silent :!sxiv %p &' let g:utl_cfg_hdl_mt_image_gif = 'silent :!sxiv %p &' let g:utl_cfg_hdl_mt_image_png = 'silent :!sxiv %p &' let g:utl_cfg_hdl_mt_application_msword = 'silent :!abiword %p &'

" }}}

" LaTeX Suite {{{ let g:Tex_DefaultTargetFormat = 'pdf'

let g:Tex_ViewRule_pdf = 'evince' let g:Tex_FormatDependency_ps = 'dvi,ps' let g:Tex_FormatDependency_pspdf = 'dvi,ps,pspdf' let g:Tex_FormatDependency_dvipdf = 'dvi,dvipdf'

" let g:Tex_IgnoredWarnings =' " \"Underfull\n". " \"Overfull\n". " \"specifier changed to\n". " \"You have requested\n". " \"Missing number, treated as zero.\n". " \"There were undefined references\n". " \"Citation %.%# undefined\n". " \"\oval, \circle, or \line size unavailable\n"'

" }}}

" Vim-scdv {{{

mapù :call SearchWord()

" }}}

" Vim-AutoSave {{{

let g:auto_save = 1 " enable AutoSave on Vim startup let g:auto_save_no_updatetime = 1

"}}}

" Vim-TranslateIt {{{

nmap ,ò TranslateIt

"}}} " VimFiler {{{

nnoremap X :VimFiler

let g:vimfiler_as_default_explorer = 1

let g:vimfiler_tree_leaf_icon = '├' let g:vimfiler_tree_opened_icon = '┐' let g:vimfiler_tree_closed_icon = '─' let g:vimfiler_file_icon = '┄' let g:vimfiler_marked_file_icon = '✓' let g:vimfiler_readonly_file_icon = '✗'

let g:vimfiler_force_overwrite_statusline = 0

let g:vimfiler_time_format = '%d-%m-%Y %H:%M:%S' let g:vimfiler_data_directory = $HOME.'/.vim/tmp/vimfiler' let g:vimfiler_safe_mode_by_default=0

" }}}

" Vim-markdown-extra-preview {{{

" map mp :Me " map mr :Mer

" let g:VMEPextensions = ['extra', 'codehilite'] " let g:VMEPhtmlreader= '/usr/bin/firefox'

" }}}

" vimux {{{

let g:VimuxUseNearestPane = 1

map rr :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;python2 '.bufname("%")) map r3 :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;python3 '.bufname("%")) map rt :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;time python2 '.bufname("%")) map rp :call VimuxRunCommand('clear;cd '.expand("%:p:h") .' ;time pypy '.bufname("%"))

map rc :VimuxPromptCommand map rl :VimuxRunLastCommand map rs :VimuxInterruptRunner map ri :VimuxInspectRunner map rq :VimuxCloseRunner

" }}}

" " Vinarise {{{

" map :Vinarise

" let g:vinarise_enable_auto_detect = 1

" au FileType vinarise let g:airline_section_warning = ''

" " }}}

" Virtualenv {{{

let g:virtualenv_auto_activate = 1 let g:virtualenv_stl_format = '(%n)'

" }}}

" winresizer {{{

let g:winresizer_start_key = '' " cancelar pulsando ESC " let g:winresizer_finish_with_escape = 1 let g:winresizer_keycode_finish = 27

" }}}

" zoomwintab {{{

map z :ZoomWinTabToggle

" }}}

" END PLUGINS SETUP }}}

" FILETYPES {{{ ==============================================================

" DJANGO HTML (Templates) {{{

au BufRead,BufNewFile /templates/.html setlocal filetype=htmldjango.html

" }}}

" JSON {{{ -------------------------------------------------------------------

augroup json_autocmd autocmd FileType json set foldmethod=syntax augroup END

" }}}

" LUA {{{

au BufRead,BufNewFile rc.lua setlocal foldmethod=marker

" }}}

" PYTHON {{{

au FileType python setlocal foldlevel=1000

" }}}

" MARKDOWN {{{

" markdown filetype file au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown autocmd FileType markdown NeoBundleSource vim-markdown autocmd FileType markdown NeoBundleSource vim-markdown-extra-preview

" }}}

" RUBY {{{

au FileType ruby setlocal tabstop=2 softtabstop=2 shiftwidth=2

" }}}

" SQL {{{

autocmd FileType sql DBCheckModeline

" }}}

" END FILETYPES }}}

" Other Customizations {{{ ====================================================

let s:vimcustomfile = $HOME.'/.vim/custom.vim'

if filereadable(s:vimcustomfile) exec 'source '.s:vimcustomfile endif

" }}}

" vim:foldmethod=marker

s

Enrico68 commented 10 years ago

Sorry guys , was the mattn/calendar. I was not aware it was installed :-)