Code Monkey home page Code Monkey logo

vim's Introduction

gergap's Vim Configuration

                                       /\        ____   ____.__
   ____   ___________  _________  _____)/ ______ \   \ /   /|__| _____
  / ___\_/ __ \_  __ \/ ___\__  \ \____ \/  ___/  \   Y   / |  |/     \
 / /_/  >  ___/|  | \/ /_/  > __ \|  |_> >___ \    \     /  |  |  Y Y  \
 \___  / \___  >__|  \___  (____  /   __/____  >    \___/   |__|__|_|  /
/_____/      \/     /_____/     \/|__|       \/                      \/

Vim is a versatile editor that I use for C/C++ development, writing bash or perl scripts, LaTeX documentation, Markdown, actually everything. Using SSH and TMux you can work remotely, keep sessions running when disconnecting and resume on later.

Currently I'm working on Debian using Suckless' DWM and the st terminal. But my config should work on other systems too. Anyway my .vimrc may contain some nice features that you can integrate into yours.

You can use my config as-is, or better read my .vimrc, understand it, and as Bruce Lee would say: "Absorb what is useful, discard what is not."

And this is what my config looks like: gergap's Vim Demo

Important shortctus

  • F2: Saves file. Works in normal mode and insert mode.
  • F3: Enables spellcheck.
  • S-F3: Disables spellcheck.
  • F4: Switches between header and corresponding source file.
  • S-F4: Like F4, but opens the counterpart in a vertical split.
  • F5: Creates/updates ctags (use git ctags, see https://tbaggery.com/2011/08/08/effortless-ctags-with-git.html)
  • F6: Creates doxygen comment for the current function.
  • F7: Builds using :make
  • S-F7: Clean build using :make clean all
  • F10: Removes trailing whitespaces of the complete file.
  • F12: Goto definition
  • S-F12: Opens definition in vertical split view.
  • M-Down: Next typo (spellchecking)
  • M-Up: Previous typo (spellchecking)

Note, that I've changed a while ago from a German keyboard to US keyboard, simply because all programming characters like e.g. []{}/\'" are easily accessisble. This also means that I don't need F12 anymore, because Vim's default CTRL-] is more handy. I just kept it, because I have no other use for it at the moment.

Special keys in vimdiff mode

  • M-Down: jump next difference
  • M-Up: jump to previous difference
  • M-Left: diffget
  • M-Right: diffput

Plugins

Vim should be only extended in Vim's way like the great plugins from Tim Pope. It makes no sense to install plugins for tasks which Vim can do out of the box. One example is the multiple-cursors plugin, Vim has Ctrl-V, there is no need for such a plugin.

My config makes use of some great vim plugins for coders. Use :PlugInstall to install them. Vimplug as the plugin manager.

An incomplete list of the most important plugins

  • Tim Pope's vim-fugitive, vim-surround, vim-unimpaired, vim-commentary, and more
  • Some new text objects: kana/vim-text-function, kana/vim-text-line
  • neoclide/coc.nvim: This replaces YCM, and provides clang based auto-completion and more
  • sirver/ultisnips: Awesome snippets support. This is a must have!
  • vim-airline: Powerline based on vim-script (no python)
  • Raimondi/delimitMate: another autoclose plugin
  • scrooloose/nerdtree: File tree for accessing files interactively
  • ctrlpvim/ctrlp.vim: Fuzzy file open support
  • majutsushi/tagbar: List functions, variable and macros of the current file.
  • rhysd/vim-clang-format: Integration of clang-format to automatically reformat code
  • gergap/vim-cmake-build: My own plugin to work with CMake based projects (run cmake, compile, debug and more)
  • ... much more

Requirements

  • vim, for obvious reasons ;-) (you will need to build vim with python support for some plugins)
  • git

Now some optional parts:

Installation

cd ~
# clone this repository
git clone [email protected]:gergap/vim.git
# now merge my config with yours or continue to replace your config completely.
# The following steps are what I'm doing to install it on various machines.
# Note: backup any existing vim configuration before you remove your .vim folder and .vimrc file.
rm -rf .vim .vimrc
# symlink your new config
ln -s vim/.vim
ln -s vim/.vimrc
# Now enjoy the best editor on earth - vim :-)

Known Issues

  • Some key mappings like S-F4 may not work in some terminals, because the terminal intercepts it.

vim's People

Contributors

gergap avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

vim's Issues

pumvisible when press the upper key

When it is in the insert mode, press the upper key will generate
"pumvisible()? "\ ":"
and it takes a long time to scan header files in usr/include.

I am using Ubuntu 14.04 and writing C++ code.

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.