You are not logged in.
Pages: 1
Hi there, I need help moving things im editing with "Vim" to my "3:code" workspace
this is the basic code in my ManageHooks segment in my xmonad.hs:
myManageHook = composeAll . concat $
[ [className =? c --> doFloat | c <- myFloats]
, [className =? e --> doF (W.shift "3:code") | e <- code]
]
where
myFloats = ["Gimp"]
code = ["Vim"]
Funny thing is if i install Gvim and add it to my ManageHook, it will move all the things im editing with Gvim to my "3:code" workspace.
But if i install vim, and open files with vim, it opens in the current workspace.
Can someone help me with this? I have a feeling its just an easy fix, i've been looking around the xmonad thread but cant find anything close to it and when i used google, i've found ppl using query and fmap with "isPrefixOf", but my haskell programming skills isnt up there yet and looking at their code is very confusing.
Thanks in advance
Last edited by ryuuzaki (2010-05-20 19:38:15)
Offline
vim doesn't run in its own window; It runs in a terminal that has its own window. I think that you'll need to use 'title' instead of 'className' somehow, but I'm not sure how to do it. xprop for an empty vim session in urxvt on my machine shows "[No Name] - VIM".
Offline
Hi,
Thanks for the reply, with your tip i looked around and here is what i got so far:
myManageHook = composeAll . concat $
[
[className =? c --> doFloat | c <- myFloats]
, [ className =? e --> doF (W.shift "3:code") | e <- code]
, [ fmap ( c `isInfixOf`) title --> doF (W.shift "3:code") | c <- code ]
]
where
myFloats = ["Gimp"]
code = ["vim", "vim:"]
It still does not switch to my "3:code" workspace. I have no idea how fmap works so any help would be helpful.
Offline
I'm still a little out of my range here, but xprop sees vim as VIM (all caps). These things are case sensitive.
Offline
I use:
...
, [ fmap ( "JAVA:" `isInfixOf`) title --> doCenterFloat]
...
to auto float any of my Java apps as I always include "JAVA:" in the window title.
This should work:
...
, [ fmap ( "VIM" `isInfixOf`) title --> doF (W.shift "3:code")]
...
though you will probably be better off with `isSuffixOf` [1] as on my system the title looks like "<filename> (<dir>) - VIM" and matching "VIM" anywhere in the title will match all sorts of things eg a google search for VIM in your browser. Even better would be to match on "- VIM" or whatever it is on your system. As skottish mentioned, check with xprop.
Offline
You can also change the vim titlestring to whatever you want via the 'titlestring' option, if you want something a bit more specific to match against.
I have 'set titlestring=[vim]\ %f' which simply turns out "[vim] filename"
Offline
Pages: 1