Dwm.vim : Tiled Window Management for Vim
vim.org
vim.org
set ttymouse=xterm2
set mouse=n
Now you can use the mouse to resize buffers and click on tabs. You can even click to focus on a buffer and don't need to meta-press your way around when you just want to browse things. Go on, click on topics inside of the help, assign the right click to supertab[1], navigate NerdTree[2] like the explorer clone it is. Collapse and expand code folds[3] like a 21st century digital boy.[4]
Furthermore, your scrollwheel all of a sudden now scrolls through your document in putty, xterm, screen, rxvt, tmux, iterm; all of them. Yes, total heresy, I know.
The only thing more important than this is doing a visual selection[5] and then doing a :!(any program) like say: fmt, sort, mail, python, rdoc, indent, bc ...
I know what you are thinking; "But kristopolous, this is so easy; it is not possible". Relax my friend, this is unix, you know this.
PS: Here's my custom vim builder/environment maker: https://github.com/kristopolous/vimbuild
[1] http://www.vim.org/scripts/script.php?script_id=1658
[2] http://www.vim.org/scripts/script.php?script_id=1643
[3] http://vimdoc.sourceforge.net/htmldoc/fold.html
Switching to zsh and oh-my-zsh has helped a lot too
Pretty much everything works out of the box as with the terminal version, you just get a few usability improvements (OS-integrated clipboard, mouse selections create vim selections and vice versa, etc).
It does not, you have to use the MouseTerm SIMBL plugin.
Works For Me™
Using lilyterm[0], a libvte based terminal.
So in a way we have gone full circle, from text editor, to window managers, back to text editor.
That said, I still prefer Acme to vim, but would be really cool if somebody added mouse chording to vim :)
I still prefer Acme to vim
If you could expand on that (compare/contrast), I would definitely be interesting in reading it (blogpost, Show HN, etc).One of my favorite things about Acme is that it requires basically no configuration, you can write small scripts to perform certain tasks, so in a way it is 'scriptable', but this are usually little more than shell pipelines to transform text.
I remember spending hours in vim simply looking around the huge mountains of documentation to find the right option to add to to my every growing vimrc, and when you wanted to do something slightly complex you had to use the rather bizarre vimscript.
Yes, vim has bindings for python and ruby and a bunch of other languages, but this brings us to another issue with vim: every installation seems to be almost unique, it has no consistent defaults, or even available features, so even carrying your personal vimrc arond (which is a pain in the ass) is not enough as it might depend on some feature not enabled in whatever vim binary you will find in a given system.
Window management and mouse chording in acme are simply a dream, while in vim i can rarely remember all the commands needed to manage windows, and the mouse is basically useless.
I could go on, but if you have tried both, you will realize that the differences are quite fundamental and even philosophical, so I don't expect every vim-head to understand and appreciate acme right away, because it will not fit with what they expect from a text editor.
All that said, I still use ed for quick edits, in part because it provides a consistent and almost universal interface, the trend some Linux distributions have of removing one of the most venerable and ancient Unix commands is very, very disturbing.
Unrelated, but I also enjoy being able to Ctrl+w,Shift+[hjkl] to move splits around relative to the other splits.
Yeah, but the point is I closed it accidentally. So now I reopen NERDTree or whatever and have to spend a bunch of time micromanaging my splits back into the arrangement I just had them in.
Wasted space sucks, but so does having things wreck my layout in an over-eager attempt to avoid it.
Flexibility can be nice, but it can also get annoying. I don't want to micromanage behavior if the environment can do the right thing for me.
The advantages are well-known and demonstrated by dwm from which this plugin is inspired
http://www.vim.org/scripts/script.php?script_id=3690
It does not take away the ability to do :split or :vsplit or force a particular layout. It does dynamically resize your windows to maximize visibility
To me, the window manager handling the window arrangement feels like The Right Thing, but vim handling the clipboard also feels right (because it interacts with many commands). So I'd like some hybrid of the two options of: 1) running multiple WM-managed vim instances; vs. 2) running one vim with vim-internal window management. I basically agree with the goal of running vim with dwm window management, but it seems wrong to have to reimplement dwm inside of vim, instead of using dwm itself to manage vim windows.
I've just found out that dwm.vim doesn't work well with tabs just yet though - it copies all buffer windows to the current tab on Ctrl-f (make active window the master focus).
nnoremap <Leader>y "+yy
nnoremap <Leader>d "+dd
noremap <Leader>p "+p
noremap <Leader>P "+P
vnoremap <Leader>y "+y
vnoremap <Leader>d "+dAlso, you can set the default yank register to be your X clipboard. Look into set clipboard = unnamed+ (make sure your vim is complied with X support for both of these)
Yes, though you will need a Vim with support for it built. See `:h client-server` for details. (I never really got into using it regularly)
nerdtree <cr> opens things in the active window, nerdtree i opens a split in the master window, and a dwm.vim focus tidies things up. no fullscreen mode is unhandy though (i've not learnt how to unmaximise from Ctrl-w _ and Ctrl-w | yet).
edit; silly me, doing Ctrl-f now unmaximises the window.
I'd love to press a key combo and have tmux bring my current pane to the large left panel, switching it with whatever I had there before.
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
You can then jump between splits with Ctrl and the navigation keys.I do not really understand the need to have a 'window manager' inside vim. I'm a long xmonad user and I think tiling window managers are great (wish there would be a worthy native os x implementation), but adding yet another plugin to my vim setup doesn't really seem feasible, especially when one can map its core functions with a couple of lines. Vim provides uncountable ways to manage splits, including resizing, switching etc, and then there is still vim's great tabs feature to be discovered to reduce the on-screen mess splits can produce...
That said, hat-tips to the author for managing to create a plugin for vim using its rather obscure vi/ex language.
+-----------+
| | |
| F | S1 |
| i | |
| l |-------|
| e | |
| s | S2 |
| | |
+-----------+I think the nicest feature of dwm.vim, though, is the "focus" and automatic layout of windows. Big left pane + lots of small panes on the right seems like a nice way of doing things...
Oh, and make it work with tmux's splits, too!
http://superuser.com/questions/465780/anyone-know-how-i-can-...
http://www.quora.com/tmux/How-can-I-use-the-same-keys-to-mov...
Something odd though: Isn't ^f supposed to do a 'page down' by default? The 'focus' part of his plugin didn't work for me and I had to change the mapping to ^m instead.
Of course, you lose the ability to use vim copy buffers between the processes, but it works well and I like the look of it.