Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Ctrl-N completion for XML/XSLT attributes
Back to page
Edit
Edit source
View history
Talk (0)
Edit Page
Ctrl-N completion for XML/XSLT attributes
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{TipImported |id=1469 |previous=1468 |next=1470 |created=January 12, 2007 |complexity=basic |author=Erik Falor |version=n/a |rating=7/7 |category1=Completion |category2=XML }} I found myself switching back into lisp mode just to get Ctrl-N to complete really long attribute names containing hyphens. However, that has the undesirable side-effect of goofing up my indentation. I decided to dig in a little deeper and fix Ctrl-N such that it wouldn't take a hyphen to be a word boundary. As an added bonus, it'll include XSL namespace prefixes in its list of words. Add this to your vimrc: <pre> if has("autocmd") autocmd FileType {xml,xslt} setlocal iskeyword=@,-,\:,48-57,_,128-167,224-235 endif "has("autocmd") </pre> '''Notes''' *This does not rely on extensions; instead it works on any file which the filetype detection identifies correctly. *It only changes the 'iskeyword' value for that buffer, not globally. ==References== *{{help|:autocommand}} *{{help|'isk'}} *{{help|file-pattern}} ==Comments== Shouldn't those ''word character'' settings rather be put into the appropriate filetype plugin? ----
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Help
(
view source
)
Template:Navigation
(
view source
)
Template:TipImported
(
view source
)
Follow on IG
TikTok
Join Fan Lab