Code Monkey home page Code Monkey logo

dotvim's Introduction

bling.vim

A highly tuned vim distribution that will blow your socks off!

introduction

this is my personal vim distribution that i have tweaked over time and evolved from a simple vanilla vimrc configuration to a full-blown distribution that it is today.

while it is very easy to install this and get up and running on a brand new machine (a use case i have), i recommend that you do not install this unless you fully understand everything that's going on inside. scan it for tips and tricks, or fork and customize it for your needs.

installation

  1. clone this repository into your ~/.vim directory
  2. git submodule init && git submodule update
  3. mv ~/.vimrc ~/.vimrc.backup
  4. create the following shim and save it as ~/.vimrc:
let g:dotvim_settings = {}
let g:dotvim_settings.version = 2
source ~/.vim/vimrc
  1. startup vim and dein will detect and ask you install any missing plugins. you can also manually initiate this with :call dein#install()
  2. done!

versioning

the g:dotvim_settings.version is a simple version number which is manually edited. it is used to detect whether significant breaking changes have been introduced so that users of the distribution can be notified accordingly.

customization

  • since the distribution is just one file, customization is straightforward. any customizations can be added to the g:dotvim_settings variable, which will be used whilst sourcing the distribution's vimrc file. here is an example:
" this is the bare minimum
let g:dotvim_settings = {}
let g:dotvim_settings.version = 1

" here are some basic customizations, please refer to the top of the vimrc file for all possible options
let g:dotvim_settings.default_indent = 3
let g:dotvim_settings.max_column = 80
let g:dotvim_settings.colorscheme = 'my_awesome_colorscheme'

" change the default directory where all miscellaneous persistent files go
let g:dotvim_settings.cache_dir = "/some/place/else"

" by default, language specific plugins are not loaded.  this can be changed with the following:
let g:dotvim_settings.plugin_groups_exclude = ['ruby','python']

" if there are groups you want always loaded, you can use this:
let g:dotvim_settings.plugin_groups_include = ['go']

" alternatively, you can set this variable to load exactly what you want
let g:dotvim_settings.plugin_groups = ['core','web']

" if there is a particular plugin you don't like, you can define this variable to disable them entirely
let g:dotvim_settings.disabled_plugins=['vim-foo','vim-bar']

" finally, load the distribution
source ~/.vim/vimrc

" anything defined here are simply overrides
set wildignore+=\*/node_modules/\*
set guifont=Wingdings:h10

autocomplete

this distribution will pick one of three combinations, in the following priority:

  1. neocomplete + neosnippet if you have lua enabled.
  2. youcompleteme + ultisnips if you have compiled YCM.
  3. neocomplcache + neosnippet if you only have vimscript available

this can be overridden with g:dotvim_settings.autocomplete_method

standard modifications

  • if you have either ack or ag installed, they will be used for grepprg
  • all temporary files are stored in ~/.vim/.cache, such as backup files and persistent undo

mappings

insert mode

  • <C-h> move the cursor left
  • <C-l> move the cursor right
  • jk, kj remapped for "smash escape"

normal mode

  • <leader>fef format entire file
  • <leader>f$ strip current line of trailing white space
  • window shortcuts
  • <leader>v vertical split
  • <leader>s horizontal split
  • <leader>vsa vertically split all buffers
  • <C-h> <C-j> <C-k> <C-l> move to window in the direction of hkjl
  • window killer
  • Q remapped to close windows and delete the buffer (if it is the last buffer window)
  • searching
    • <leader>fw find the word under cursor into the quickfix list
    • <leader>ff find the last search into the quickfix list
    • / replaced with /\v for sane regex searching
    • <cr> toggles hlsearch
  • <Down> <Up> maps to :bprev and :bnext respectively
  • <Left> <Right> maps to :tabprev and :tabnext respectively
  • gp remapped to visually reselect the last paste
  • gb for quick going to buffer
  • <leader>l toggles list and nolist
  • profiling shortcuts
    • <leader>DD starts profiling all functions and files into a file profile.log
    • <leader>DP pauses profiling
    • <leader>DC continues profiling
    • <leader>DQ finishes profiling and exits vim

visual mode

  • <leader>s sort selection
  • > and < automatically reselects the visual selection

plugins

  • this is an extremely powerful plugin that lets you build up lists from arbitrary sources
  • mappings
  • <space><space> go to anything (files, buffers, MRU, bookmarks)
  • <space>y select from previous yanks
  • <space>l select line from current buffer
  • <space>b select from current buffers
  • <space>o select from outline of current file
  • <space>s quick switch buffer
  • <space>/ recursively search all files for matching text (uses ag or ack if found)
  • <leader>bd or :BD will kill a buffer without changing the window layout
  • motion on steriods
  • makes search/replacing in your project a lot easier without relying on find and sed
  • the loading time of this plugin is relatively heavy, so it is not loaded at startup. to load it on-demand, use <leader>vo, which opens the options window.
  • <leader>vv find word under the cursor
  • <leader>vV find whole word under the cursor
  • <leader>vr perform global search replace of word under cursor, with confirmation
  • <leader>vR same as vr, but matches whole word
  • git wrapper
  • <leader>gs status
  • <leader>gd diff
  • <leader>gc commit
  • <leader>gb blame
  • <leader>gl log
  • <leader>gp push
  • <leader>gw stage
  • <leader>gr rm
  • in addition to all the standard bindings when in the git status window, you can also use U to perform a git checkout -- on the current file
  • nice log history viewer for git
  • <leader>gv
  • many additional bracket [] maps
  • <C-up> to move lines up
  • <C-down> to move lines down
  • file browser
  • <F2> toggle browser
  • <F3> open tree to path of the current file
  • very versatile commenting plugin that can do motions
  • gcc to toggle or gc{motion}
  • fuzzy file searching
  • <C-p> to bring up the search
  • \t search the current buffer tags
  • \T search global tags
  • \l search all lines of all buffers
  • \b search open buffers
  • \o parses the current file for functions with funky
  • <leader>nr puts the current visual selection into a new scratch buffer, allowing you to perform global commands and merge changes to the original file automatically
  • easily aligns code
  • <leader>a&, <leader>a=, <leader>a:, <leader>a,, <leader>a|
  • automatically get or push changes for gists with :Gist
  • makes for writing html/css extremely fast
  • for supported most filetypes, <tab> will be mapped to automatically expand the line (you can use <C-v><Tab> to insert a tab character if needed)
  • for other features, default plugin mappings are available, which means <C-y> is the prefix, followed by a variety of options (see :help zencoding)
  • visualize the undo tree
  • <F5> to toggle
  • amazingly fast fuzzy autocomplete engine combined with an excellent snippets library
  • use <C-n> and <C-p> to go back/forward between selections, and <tab> to expand snippets
  • autocomplete/snippet support as a fallback choice when YCM and/or python is unavailable
  • <Tab> to select the next match, or expand if the keyword is a snippet
  • if you have lua installed, it will use neocomplete instead
  • <leader>c splits a new window with an embedded shell
  • mapped to <C-N>, this will select all matching words and lets you concurrently change all matches at the same time

and some more plugins

  • surround makes for quick work of surrounds
  • repeat repeat plugin commands
  • speeddating Ctrl+A and Ctrl+X for dates
  • gist awesome plugin for your gist needs
  • signature shows marks beside line numbers
  • matchit makes your % more awesome
  • syntastic awesome syntax checking for a variety of languages
  • bufferline simple plugin which prints all your open buffers in the command bar
  • indent-guides vertical lines
  • signify adds + and - to the signs column when changes are detected to source control files (supports git/hg/svn)
  • delimitmate automagically adds closing quotes and braces
  • startify gives you a better start screen

and even more plugins...

  • i think i've listed about half of the plugins contained in this distribution, so please have a look at the vimrc directly to see all plugins in use

credits

i wanted to give special thanks to all of the people who worked on the following projects, or people simply posted their vim distributions, because i learned a lot and took many ideas and incorporated them into my configuration.

license

WTFPL

changelog

  • v2
  • NeoBundle replaced with dein
  • v1
  • requires g:dotvim_settings.version to be defined
  • disable all langauge-specific plugins by default
  • add support for g:dotvim_settings.plugin_groups_include

dotvim's People

Contributors

bebound avatar bling avatar decrement avatar elcash avatar hamled avatar jc4x4 avatar nkalvi avatar rajeshduggal avatar yachi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotvim's Issues

Installation Error: Segmentation fault: 11

Hello, I have an error after run "cd .vim; make install", just after download all neobundle packages (On OSX Yosemite 10.10.5, xcode Version 6.4 (6E35b) ):

vim -u bundles.vim +NeoBundleClean +NeoBundleCheck +NeoBundleDocs
Vim: Caught deadly signal SEGV
Vim: Finished.
make: *** [cleanup] Segmentation fault: 11

Any idea?

Thanks.

so $MYVIMRC breaks

Hey
Whenever I try to do a so $MYVIMRC it just breaks the color scheme and also for some reason it thinks that the buffer has changed even though it hasn't
I have wrapped all the autocommands in augroups with au! .
Also I have tried disabling all the plugins the problem still remains

insert mode mapping C-h sends delete key

is there any workaround for this from within vim?
when i press C-h, instead of going left one charachter, my terminal actually send C-h which deletes one character

Can't do reverse search in vim-sneak

The default SneakPrevious key is , and \
Currently, , not work, \ is remaped by CtrlP .
I add nmap , <Plug>SneakPrevious seems work, but I don't know if this will make any bad influence, and what's the more elegant way to tackle it?

using tabs

I love the look and feel of the interface, but am having a hard time finding a good tree/tab workflow. Could you point me towards a guide, doc, list of mappings, etc to help me out? I want to do something like this:

  1. Open a file from the Terminal with the file explorer pre-opened in the left pane to that files folder
  2. Select a few files from the file explorer to open (this is easy, just select one)
  3. Close one of the open files from the upper tabs (I can use Q, but then ...)
  4. Select another file from the upper tabs (pressing left/right closes the split pane)

How do you handle this type of workflow? Thanks!

Emacs Init Error

Cloned dotemacs directory into ~/.emacs.d
Received error below. Running Emacs 24.3 on Xbunutu 14.04.

Debugger entered--Lisp error: (wrong-number-of-arguments quote 10)
(quote special-mode eshell-mode comint-mode project-explorer-mode git-commit-mode diff-mode custom-mode dired-mode calendar-mode help-mode)
eval((quote special-mode eshell-mode comint-mode project-explorer-mode git-commit-mode diff-mode custom-mode dired-mode calendar-mode help-mode))
custom-initialize-reset(dotemacs-evil-emacs-state-modes (quote special-mode eshell-mode comint-mode project-explorer-mode git-commit-mode diff-mode custom-mode dired-mode calendar-mode help-mode))
custom-declare-variable(dotemacs-evil-emacs-state-modes (quote special-mode eshell-mode comint-mode project-explorer-mode git-commit-mode diff-mode custom-mode dired-mode calendar-mode help-mode) "List of modes where Evil should start up in Emacs state." :type (repeat (symbol)) :group dotemacs)
eval-buffer(#<buffer load-550218> nil "/home/lmauldin/.emacs.d/config/init-evil.el" nil t) ; Reading at buffer position 1219
load-with-code-conversion("/home/lmauldin/.emacs.d/config/init-evil.el" "/home/lmauldin/.emacs.d/config/init-evil.el" nil t)
require(init-evil)
(while --dolist-tail-- (setq module (car --dolist-tail--)) (require module) (setq --dolist-tail-- (cdr --dolist-tail--)))
(let ((--dolist-tail-- dotemacs-modules) module) (while --dolist-tail-- (setq module (car --dolist-tail--)) (require module) (setq --dolist-tail-- (cdr --dolist-tail--))))
(progn (let ((--dolist-tail-- dotemacs-modules) module) (while --dolist-tail-- (setq module (car --dolist-tail--)) (require module) (setq --dolist-tail-- (cdr --dolist-tail--)))))
eval-buffer(#<buffer load> nil "/home/lmauldin/.emacs.d/init.el" nil t) ; Reading at buffer position 1284
load-with-code-conversion("/home/lmauldin/.emacs.d/init.el" "/home/lmauldin/.emacs.d/init.el" t t)
load("/home/lmauldin/.emacs.d/init" t t)
#[0 "�\205\262� \306=\203��\307�\310Q\202;� \311=\204��\307�\312Q\202;�\313\307\314\315#\203*�\316\202;�\313\307\314\317#\203:�\320\nB�\321\202;�\316\322�\323�\322\211#\210�\322=\203a�\324\325\326\307�\327Q!"\323�\322\211#\210�\322=\203���\210�\203\243�\330�!\331\232\203\243�\332�!\211\333P\334�!\203}�\211\202\210�\334�!\203\207��\202\210�\314\262��\203\241�\335��\"\203\237�\336\337��#\210\340\341!\210��\266�\f?\205\260�\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
command-line()
normal-top-level()

etags-select unavaliable

I use you config to start emacs, got an error:
[INIT ERROR] /Users/tomyli/.emacs.d/config/config-misc.el (error Package ‘etags-select-’ is unavailable)
I found etags-select not in the melpa repo, What should i do ?

vimshell default dir

setting the cache dir for vimshell creates symlink to home folder at every place I use it,
had to disable that to make it work properly

Some questions about your vimrc

Hey bling, great vimrc. It's very well organized, I learned a lot. I have a couple of questions.

  1. On line #498 in your vimrc you have NeoBundle 'kien/ctrlp.vim', { 'depends': 'tacahiroy/ctrlp-funky' }. My understanding of depends is that if plugin1 is dependent upon plugin2, i.e. if plugin1 is required for plugin2 to work, it should be specified as NeoBundle 'plugin1', { 'depends': 'plugin2' }. Is my understanding correct?
  2. On line #623 in your vimrc you have NeoBundleDepends 'kana/vim-textobj-user' and on line #624 NeoBundle 'kana/vim-textobj-indent'. Why not simply write them as NeoBundle 'kana/vim-textobj-indent', { 'depends': 'kana/vim-textobj-user' }. Is there any advantage in writing it the way you have?

Default Installation overrides 's'

Hey. First, love the dotvim.

I looked through .vim/vimrc for what is overriding s. When I press s in command mode i get '>' appearing for fast search, but I want delete + go into insert mode (standard use).

I see that, when i execute :nmap that <Plug>Sneak_s has commandeered s from me but I cannot seem to disable that plugin. I have tried the following

let g:dotvim_settings.disabled_plugins=['Sneak_s']
let g:dotvim_settings.plugin_groups_exclude = ['Sneak_s']
let g:dotvim_settings.disabled_plugins=['sneak']
let g:dotvim_settings.plugin_groups_exclude = ['sneak']

My question is there a way to restore default s behavior or what plugin should I disable and how to restore s behavior? Thanks

some problems

Hi,I'm using this vimrc on windows,and I got some problems, would you please help me?

I'm a noob and I altered the vimrc, so these errors are likely to be result from my wrong modification.
Medicated vimrc is here: https://gist.github.com/bebound/5845032

1 If using lines=999 columns=999 ,the start position is incorrect, is X 129, Y 6,and winpos can't change it.
2 Start buffer path incorrect,too many""(Original vimrc is correct,maybe I change it incorrectly),I want to know which plugin change the start buffer.
3 If I try to open a file in start buffer,I will got this error:"Error detected while processing function 101_open_buffers: Line 17; E472 Command failed"
4 While using anything in unite.vim,it will show an error:"Error detected while processing gfuncion
neobundle#autoload#command..neobundle#source..neobundle#call_hook>>24:line 4: E117:Unknow function :unite#custom#source"
5 The color of the char "tab" is too dark,I don't know which option can make this effect.

How do you usually yanking text?

I have not found such plugins as vim-yankitute or ExtractMatches in your dotfiles, so I wonder how you will, let say, yank to clipboard words in brackets and make them comma-separated

- 'autoindent' is set by default
- 'autoread' is set by default
- 'backspace' defaults to "indent,eol,start"
- 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|)
- 'complete' doesn't include "i"
- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created

Output must be autoindent, autoread, ....

autocomplete issue

I would like to findout how to trigger autocomplete using tab or any other key. If i scroll up down the file autocomplete is interrupting and blocking the view, it is extremely annoying to get out of autocomplete and keep browsing the file. Thanks in advance.

Kind Regards,
Sandeep

vim-plug

vim-plug runs much faster than NeoBundle—would you ever migrate to that? (I don't know whether it's missing anything NB has that dotvim needs.)

about vim-sneak

Can't use ; to go to the next match.

After use sab to search for ab, click ";", nothing happened. I can't find problem in vimrc, do you have any idea about this problem? Thank you.

Getting weird character for strings on JSON files

Hi,

I am having issues with JSON files. The quotes are displayed as triangles. I attach a picture of the problem. I have verified that this is not caused by my typography. Using iterm2 on mac.

Thanks in advance.

screen shot 2016-06-03 at 12 46 14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.