Giter VIP home page Giter VIP logo

no_plugins's Introduction

How to Do 90% of What Plugins Do (With Just Vim)

This is a supplementary repository for my August 3, 2016 talk How to Do 90% of What Plugins Do (With Just Vim).

You may also be interested in my Vim cheat sheets:

Basic (Digital | Print):

Basic Vim Cheat Sheet

Advanced (Digital | Print):

Advanced Vim Cheat Sheet

Summary

Fuzzy File Search

When moving to another buffer with :b, hit tab to autocomplete, or simply hit Enter to go to the first buffer with a unique match to what you have already typed.

By adding set path+=** and set wildmenu to the vimrc, we are now able to hit Tab when running a :find command to expand partial matches.

Another asterisk (*) can be placed in the query to return fuzzy/partial matches.

Tag jumping

First, download and run ctags in your project directory like this: ctags -R .

Make sure your Vim working directory is in the same directory as the tags file that gets generated.

Now, you are able to use ^] to jump to a tag under the cursor, g^] to get a listing of all matching tags, and ^t to jump back up the tag stack.

Autocomplete

Vim has plenty of ways to do autocomplete. The best is ^n which works out of the box according to the complete option. Use ^p to go back in the suggestion list, ^y to accept the current completion choice, and ^e to cancel out of the autocompletion dialog to return to your text without making a selection.

There are also a number of other autocomplete features prefixed by ^x:

  • ^x^n to search within the file
  • ^x^f to complete filenames (works with path+=**!)
  • ^x^] to complete only tags

And more! :help ins-completion for a full listing.

File Browsing

Vim ships with a builtin file browser called NetRW. To use it, just run :E.

Snippets

Here's an example of a minimal snippet command you can put in your vimrc:

nnoremap ,html :-1read $HOME/.vim/.skeleton.html<CR>

Assuming that your home vim directory contains a text file called .skeleton.html, which contains (for example) an empty HTML document, this mapping will insert a copy of the text file in the current file when you type ,html in normal mode.

Build Integration

See the bottom of no_plugins.vim for an explanation of how to integrate Vim with a simple Ruby RSpec build process (warning: this has not been updated since 2016, so it probably does not work anymore).

no_plugins's People

Contributors

changemewtf avatar

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.