Git Product home page Git Product logo

ez-window's Introduction

Hi there, I'm Kamil ๐Ÿ‘‹

  • Atlassian Guru ๐Ÿ–ฅ
  • Python + Zsh + Vim + Tmux == โค๏ธ
  • ๐ŸŒฑ Iโ€™m currently learning everything

AnotherProksY Top Languages

AnotherProksY Github Stats


Languages and Tools:

Vim

Terminal

Bash

Fish

Python

Java

HTML5

CSS3

Postgresql

SQL

Git

GitHub

Markdown

JSON

MacOS

Ubuntu

Telegram

ez-window's People

Contributors

anotherproksy avatar

Watchers

 avatar

Forkers

brummer-simon

ez-window's Issues

Fix "No buffers were deleted: bd! {num}"

Issue Summary

If you close terminal buffer with :q or other commands, then next <C-t> execution will failed:

Error detected while processing function <SNR>38_NewTerminal:
line 3:

function! s:NewTerminal()
  if has('nvim')
    if exists('t:terminal_buffer')
      exe "bd! " . t:terminal_buffer " <-----
      unlet t:terminal_buffer
    else
      botright split
      resize 10
      terminal
      let t:terminal_buffer = bufnr()
      normal i
    endif
  else
    echo "Sorry, you are not a 'NeoVim' user ;("
  endif
endfunction

Steps to Reproduce

  1. Create new terminal split <C-t>
  2. Hit <C-\><C-n> to quit terminal insert mode
  3. Close terminal split with any commands
  4. Hit <C-t> again

Expected Results

It will create new terminal split.

Actual Results

It will throw an error message.

Workaround

Check if buffer exists, before closing it.

Add support for Tmux splits

If you use <C-hjkl> to navigate Tmux splits, then you might stuck inside Vim pane.
<C-hjkl> inside Vim will create new splits, instead of navigating to different terminals.

Need to implement global variable to disable split creation inside function and set different mappings for this behaviour:

function! s: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

Fix 'Open Terminal' behaviour

Issue Summary

If you create a few splits after hitting <C-t> (create new terminal bottom split), the next shortcut execution will close different split, instead of terminal.

Steps to Reproduce

  1. Create new terminal split <C-t>
  2. Hit <C-\><C-n> to quit terminal insert mode
  3. Create new empty split
  4. Hit <C-t> again

Expected Results

It will close terminal split.

Actual Results

It will close different split, instead of terminal one.

Workaround

This feature uses winnr() function, which saves current split ID number.
ID number changes after each :split command.
This implementation must be changed:

if exists('t:terminal_buffer')
    exe t:terminal_buffer . "wincmd c"
    unlet t:terminal_buffer
else
    botright split
    let t:terminal_buffer = winnr()
    resize 10
    terminal
    normal i
endif

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.