GithubHelp home page GithubHelp logo

a-dubaj / i3-vim-nav Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fu5ha/i3-vim-nav

0.0 0.0 0.0 1.71 MB

Seamlessly navigate i3 windows and vim splits

License: GNU Lesser General Public License v2.1

Python 9.21% Vim Script 45.34% Go 45.45%

i3-vim-nav's Introduction

i3-vim-nav

Seamlessly change focus between i3 windows and Vim splits using the same hotkey.

Installation

Dependencies

This depends on you having a couple packages installed. Most notably, xdotool/libxdo, the second of which should be installed as a dependency of the first. If you want to build the binary from source and you're on Fedora, you'll also need the libxdo-devel package. We also currently require you to be using a version of vim with either python or python3 support.

Vim plugin

First, install the Vim plugin.

Using vim-plug

In your .vimrc (vim) or .config/nvim/init.vim (neovim):

Plug 'termhn/i3-vim-nav'
	
" i3 integration
nnoremap <silent> <c-l> :call Focus('right', 'l')<CR>
nnoremap <silent> <c-h> :call Focus('left', 'h')<CR>
nnoremap <silent> <c-k> :call Focus('up', 'k')<CR>
nnoremap <silent> <c-j> :call Focus('down', 'j')<CR>

Using Pathogen

  1. cd ~/.vim/bundle
  2. git clone https://github.com/termhn/i3-vim-nav
  3. add the following to your .vimrc
" i3 integration
nnoremap <silent> <c-l> :call Focus('right', 'l')<CR>
nnoremap <silent> <c-h> :call Focus('left', 'h')<CR>
nnoremap <silent> <c-k> :call Focus('up', 'k')<CR>
nnoremap <silent> <c-j> :call Focus('down', 'j')<CR>

Binary

Next, install the binary on your PATH. If you have go installed, this can be done simply by

go get -u github.com/termhn/i3-vim-nav

If not, you can symlink the binary from its downloaded directory (this changes based on which plugin manager you used and if you're using vim or neovim) into /usr/local/bin. For example, if you used Pathogen on default Vim, this would be:

ln -s ~/.vim/bundle/i3-vim-nav/i3-vim-nav /usr/local/bin

Then, in your i3 config (adjust the path to the executable as necessary if you installed it differently). Feel free to change the key bind as you please.

bindsym --release $mod+h exec --no-startup-id "i3-vim-nav h"
bindsym --release $mod+j exec --no-startup-id "i3-vim-nav j"
bindsym --release $mod+k exec --no-startup-id "i3-vim-nav k"
bindsym --release $mod+l exec --no-startup-id "i3-vim-nav l"

Note: I've gotten a bug where in some installations of i3, it seems to not respect user $PATH additions, even though it seems to recognize them in the variable. If it doesn't work when placed in a user $PATH directory, try hard-coding the path to the binary in the exec commands.

i3-vim-nav's People

Contributors

fu5ha avatar isaaclo123 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.