jwilm / i3-vim-focus Goto Github PK
View Code? Open in Web Editor NEWVim plugin for seamless navigation between i3 and vim
Vim plugin for seamless navigation between i3 and vim
Followed the instructions by adding the settings in .vimrc, .bashrc and compiled the rust package.
$ cd ~/.vim/bundle/i3-vim-focus/i3-vim-focus/src
$ i3-vim-focus left
-bash: i3-vim-focus: command not found
First of I want to thank you for this wonderful plugin! It does the job perfectly and I am super happy with it.
I ran into an interesting situation today.
I had to run VIM on remote server, which I was connected to via SSH with X forwarding.
When I tried to move away from my remote VIM instance I got stuck.
The reason for that is that i3-msg was executing on remote host and could not do IPC communication via socket that was opened on my local machine.
This happens because VIM part of the plugin executes on whatever host VIM is running, in my case remote host.
And so I was thinking and realized that you don't really need VIM plugin portion at all, rather you can replace it with something like this in your rust program:
let remoteexpr = format!(
"execute('exe \"let oldw = winnr() | wincmd {} | let neww = winnr() | echo oldw - neww \"')",
direction.to_vim_direction()
);
let vim_result =
Command::new(&vim) // XXX hard-coded path
.args(&["--servername", &servername[..], "--remote-expr", &remoteexpr[..]])
.stdout(Stdio::piped())
.output()
.expect("ran vim command")
.stdout;
let vim_window_diff : i32 =
String::from_utf8(vim_result)
.unwrap()
.trim()
.parse()
.unwrap();
if vim_window_diff != 0 {
return;
}
And now based on the vim_window_diff you either done or you falling through to call i3 from rust program.
This way i3 part always executes on the hosts where i3 is running.
Hi!
Unfortunately it doesn't seem to work on my configuration.
I made sure to have the vim bindings configured (`gw+direction) as well as setting the window name to VIM (set titlestring=VIM). I also have the bindings on i3 config, and my vim is compiled with python support.
Anything else I could check/try?
Thanks!
Antonio
Hi
$ cd ~/.vim/bundle/i3-vim-focus/i3-vim-focus
$ cargo build --release
Returns
= note: /usr/bin/ld: cannot find -lxdo
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: Could not compile `i3-vim-focus`.
Hi
As soon as vim/gvim gets focus, the function stops working. Any idea what else I could try?
My .vimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugins "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set rtp+=~/.vim/bundle/Vundle.vim " set the runtime path to include Vundle and initialize
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'jwilm/i3-vim-focus'
" Put your non-Plugin stuff after this line
call vundle#end() " required
filetype plugin indent on " required
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PluginSettings "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" i3/vim navigation
map gwl :call Focus('right', 'l')<CR>
map gwh :call Focus('left', 'h')<CR>
map gwk :call Focus('up', 'k')<CR>
map gwj :call Focus('down', 'j')<CR>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.