You are not logged in.
Pages: 1
Hello guys,
I'd like to spend a deeper look on Vim as it should be a great editor for nearly everything.
The most of the time I'm working with CSS/HTML/JS/Django(Python). Does anyone of you have a well proved vimrc for this task area?
I just want to see what's possible concerning syntax completion, highlighting etc.
Thank you in advance.
Offline
No.
Really, customizing Vim is very subjective, if you want to "spend a deeper look" i advise you to experiment yourself (you're not lazy are you?). A good tip though would be the supertab plugin, that does a bunch of intelligent code completion. First hit in google.
ᶘ ᵒᴥᵒᶅ
Offline
My suggestions:
HTML plugin: http://www.infynity.spodzone.com/vim/HTML/
Remap Esc to CapLock, here is my .Xmodmap:
remove Lock = Caps_Lock
keysym Caps_Lock = Escape
(Works only in X)
some useful .vimrc configurations:
"tab navigation like firefox
map <C-Tab> :tabnext <CR>
imap <C-Tab> <ESC> :tabnext <CR>
map <C-S-Tab> :tabprevious <CR>
imap <C-S-Tab> <ESC> :tabprevious <CR>
"useful abbreviations
ab xmlver <?xml version="1.0" encoding="utf-8"?>
ab xmlnsp xmlns:mx="http://www.adobe.com/2006/mxml"
ab xmlcmt <!-- --><ESC>3hi
ab cdata <![CDATA[ ]]><ESC>3hi
"===================================================================
" xhtml plugin tweaks
"===================================================================
let g:do_xhtml_mappings=1
let g:no_html_tab_mapping=1
let g:no_html_toolbar=1
I don't know for python but for php I use xdebug + debugger.vim. Check here it seems that there are plug-ins for python and django framework:
http://lucumr.pocoo.org/2007/4/2/vim-as … nvironment
Last edited by ArchArael (2009-12-27 13:54:39)
Offline
Another way to swap Caps Lock and Esc is to add this to ~/.xinitrc:
setxkbmap -option caps:swapescape &
This way if for some bizarre reason one actually uses Caps Lock, it will still exist as Esc.
Offline
I actually stared at my Caps Lock key for 2 seconds thinking, but then how will they type Control? :-)
Offline
These are mine. This effectively switches ESC and Caps Lock keys.
I put the xmodmap line into a script because I use this setup on demand only.
bp:~/bin$ cat SWAP_EC
#!/bin/bash
#
# Swap Esc and Caps Lock keys.
xmodmap ~/.config/swapEscCL
bp:~/bin$ cat ~/.config/swapEscCL
! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
There is a thread here from which this was stolen mainly.
But I forgot which one (too lazy to search).
Edit: And, yes, +1 for HTML.vim!
Last edited by bernarcher (2010-02-07 16:13:00)
To know or not to know ...
... the questions remain forever.
Offline
You can always refer to http://dotfiles.org/ Some people put their dotfiles on github too.
Offline
You can always refer to http://dotfiles.org/
That's been dead for a while, hasn't it? http://web.archive.org/web/*/dotfiles.org
Or is it making sporadic reappearances?
EDIT: attempts just now to get through failed, as previous attempts have. And wayback doesn't have anything since 2008. But just now, trying a second time, I do get through to a 2010-dated page. So maybe it's coming back.
Last edited by Profjim (2010-02-07 19:13:25)
Offline
EDIT: attempts just now to get through failed, as previous attempts have. And wayback doesn't have anything since 2008. But just now, trying a second time, I do get through to a 2010-dated page. So maybe it's coming back.
It's been working for me since mid-January or so. I mean I can look through dotfiles (the important part), but I can't login or create an account. It seems they're using a pretty old database since my username doesn't seem to exist.
Offline
Sparkup is pretty cool, basically "Zen Coding" for VIM, which lets you write HTML with CSS selector-like syntax. Also has convenient shortcuts for doctype declarations etc, see http://github.com/rstacruz/sparkup
Other than that, if you aren't already aware of all the text objects vim has, get used to using 'cit' and 'ci>' to change text between <tag></tag> or inside <tag> respectively, or 'dit' and 'di>' etc. Very useful and makes for quick editing
Offline
Vim will validate your HTML and PHP syntax after saving if you add this to your vimrc file
au BufWritePost *.html !tidy -eq %
au BufWritePost *.htm !tidy -eq %
au BufWritePost *.php !php -l %
Offline
Pages: 1