Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherProksY committed Jul 20, 2020
0 parents commit c6b7b67
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.swp
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Easy Window
==========
Simple and small plugin for fast navigation between windows.

![Imgur](https://i.imgur.com/SOBhnQm.gif?1)

Will create a new window, if it didn't exist earlier or move to an existing one.

Installation
------------

* Manual
* Copy `plugin/ez-window.vim` to `~/.vim/plugin`
* [Pathogen](https://github.com/tpope/vim-pathogen)
* `git clone git://github.com/AnotherProksY/ez-window.git ~/.vim/bundle/vim-ez-window`
* [Vundle](https://github.com/VundleVim/Vundle.vim)
* `Plugin 'AnotherProksY/ez-window'`
* [Vim-Plug](https://github.com/junegunn/vim-plug)
* `Plug 'AnotherProksY/ez-window'`

Shortcuts
---------

<C-h> : New window or Move Left.
<C-j> : New window or Move Down.
<C-k> : New window or Move Up.
<C-l> : New window or Move Right.
29 changes: 29 additions & 0 deletions plugin/ez-window.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
" Simple and small plugin for fast navigation between windows.
" Maintainer: AnotherProksY <[email protected]>
" Repository: https://github.com/AnotherProksY/ez-window

if exists('g:loaded_ezwindow') || &cp
finish
end
let g:loaded_ezwindow = 1


function! EzWindow(key)
let t:curwin = winnr()
exec "wincmd ".a:key
if (t:curwin == winnr())
if (match(a:key,'[jk]'))
wincmd v
else
wincmd s
endif
exec "wincmd ".a:key | enew
endif
endfunction


" Mapping
nmap <silent> <C-h> :call EzWindow('h')<CR>
nmap <silent> <C-j> :call EzWindow('j')<CR>
nmap <silent> <C-k> :call EzWindow('k')<CR>
nmap <silent> <C-l> :call EzWindow('l')<CR>

0 comments on commit c6b7b67

Please sign in to comment.