Giter Club home page Giter Club logo

nvimfiles's Introduction

Nvimfiles

Support for JavaScript, TypeScript, Ember, React, Golang, Ruby, Elixir, Git, Sparkup, Sass, JSX, Markdown, and more with nice color schemes.

Neovim only!

Quick Install

sh -c "$(curl -fsSL https://raw.github.com/josemarluedke/nvimfiles/master/install.sh)"

Please also check install dependencies section.

Usage

Basic Mappings

The leader key is mapped to ,, you can change it in your ~/.config/nvim/init.local.vim.

Action Hotkey
▶ File operations
File browser (NerdTree) leader m
uzzyFinder (FZF) t
Switch between the last two files leader leader
Navigate to current open file in NerdTree leader f
▶ Search & Find/replace
Multiple Cursor ctrl+d
Search in files (Ag/Silver Searcher) leader a
Remove search highlighting leader Space
Toggle search highlighting leader hs
Find and replace leader s
▶ Others
Indent >> or Command ]
Reverse Indent << or Command [
Switching between windows ctrl+h ctrl+j ctrl+k ctrl+l
Toggle comments leader /
Auto complete or expand snippet <tab>
Expand CSS selectors div.event in to markup ctrl+e
Split a one-liner into multiple lines (splitjoin.vim) gS
Join a block into a single-line statement (splitjoin.vim) gJ

See .vimrc for more.

Plugins

Coc

Intellisense engine for Neovim, full language server protocol support as VSCode.

Ember.js

Similar to vim-rails, but for Ember.js.

Sparkup (ctrl+e)

Expand CSS selectors div.event in to markup <div class='event'></div>

http://net.tutsplus.com/articles/general/quick-tip-even-quicker-markup-with-sparkup/

Fugitive

Git integration

Lots of stuff

:Gstatus and press - to stage file

http://vimcasts.org/episodes/fugitive-vim---a-complement-to-command-line-git/

:help fugitive

Abolish

Use:

:%Subvert/facilit{y,ies}/building{,s}/g

Instead:

:%s/facilities/buildings/g :%s/Facilities/Buildings/g :%s/FACILITIES/BUILDINGS/g

Coercion

Want to turn fooBar into foo_bar? Press crs (coerce to snake_case).

  • MixedCase (crm)
  • camelCase (crc)
  • snake_case (crs)
  • and UPPER_CASE (cru)

Rename

Rename the current file

:rename[!] {newname}

FZF (t)

Find files in your project with minimal key presses

For example conadus would find controllers/admin/users

Neerd Commenter (Command + / or <leader>/)

Comment/Uncomment stuff out

Nerdtree (<leader>m)

Project file browser

<leader>m opens file browser

o / x open and close files/folders

m menu to move/delete/copy files/folders

? Help

I use nerdtree for creating or moving files, but I find FuzzyFinders quicker for opening files.

Surround (ys/cs/ds)

Allows adding/removing/changing of surroundings

I would highly recommend getting to know this plugin, it is very useful. Especially when you grok text objects.

Characters

ysiw) - surround inner word with ()

ysiw( - surround inner word with ( )

In the above example iw can be replaced with any text object or motion.

If you find yourself manually adding surroundings, stop and work out the correct text object or motion.

cs"' - change surrounding from " to '

ds - delete surrounding

Tags

yss<p> - surround line in <p> tags

cst<div> - change surround tag to <div>

Airline

Lean & mean status/tabline for vim that's light as air

Plug

Plugin manager and part of the reason why my nvimfiles are so compact

Format JSON strings

If you have a one line JSON string and want to indend and format it you can use this command:

:FormatJSON

Disable directions key navigation

If you are not used to use hjkl keys to navigate throught files, I recommend adding the following code to your ~/.config/nvim/init.local.vim to disable navigation using the arrows keys. This will make you use hjkl keys instead of arrows.

noremap <up>    :echoerr 'Use K to go up'<CR>
noremap <down>  :echoerr 'Use J to go down'<CR>
noremap <left>  :echoerr 'Use H to go left'<CR>
noremap <right> :echoerr 'Use L to go right'<CR>

Installation

Install Neovim (if not already installed)

brew install neovim

Install these nvimfiles

Note: You will already have a ~/.config/nvim folder, either delete or move it.

mv ~/.config/nvim ~/.config/nvim.old
git clone https://github.com/josemarluedke/nvimfiles ~/.config/nvim
cd ~/.config/nvim
make install

or run:

sh -c "$(curl -fsSL https://raw.github.com/josemarluedke/nvimfiles/master/install.sh)"

To update to the latest nvimfiles

cd ~/.config/nvim
make update

Neovim

Symlink the nvimfiles to work with neovim
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vim/vimrc ~/.config/nvim/init.vim
Install python for neovim

pip install neovim or pip3 install neovim

Install Dependencies

MacOS
brew install fzf ripgrep the_silver_searcher

Thanks for inspiration

nvimfiles's People

Contributors

barboza avatar josemarluedke avatar ssjr avatar

Watchers

 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.