After opening a file in vim,And if that file is created by root .How to change the current user to superuser mode without quitting or before saving.
Thanks.
Hi,
I'm a big fan of Resharper in visual studio. It has some awesome refactoring tools, similar to what you get in Ecplipse for Java. Is there anything like this for Ruby? Better yet, is there a plugin or something into VIM that does refactoring for Ruby code like renaming all instances of a method or variable, renaming classes sitewide, etc?
thanks,
craig
How to set vim to not indent namespace content in C++?
namespace
{
< statement_list > // Unwanted indentation
}
Surprisingly, 'cinoptions' doesn't provide a way to edit namespace content indentation.
(Mac)Vim seems to be picking up /usr/bin/python instead of the one that's at the front of my path (/Library/Frameworks/Python.framework/Versions/2.6/bin/python) when I use the :python command. Is this entirely a compile-time thing or can I somehow override it?
Hi all,
I am trying to setup cscope to work with vim, following http://cscope.sourceforge.net/cscope_vim_tutorial.html. When I get into a C file, I am not able to do what is described in bullet 5 of the link.
Do I need to setup ctags? Is there something not mentioned here on the page that I should be doing?
Thanks in advance.
I've been googling around trying to figure out if it's possible to use my mouse wheel to scroll while inside Vim in Mac's Terminal, with no luck. It seems as if only X11 or iTerm support this.
Before I give up, I thought I'd try the geniuses here to see if anyone knows a way to do this. So, does anyone know if I can set that up?
Or should I seriously consider using a different terminal application?
The tip. The errors are "E349: No identifier unders cursor", "E433: No tags file" and "E426: tag not found: public". I feel them unrelated or I cannot understand their message. I have the code in "~/.vimrc" and pressed "F1", "F9" and "ESC". A related tip but more advanced. so how can I add Java import statements automatically in Vim?
So, I am doing this search in vim:
/\(\(unum\)\|\(player\)=\)\@<!\"1\"
and as expected it does not match lines that have:
player="1"
but matches lines that have:
unum="1"
what am i doing wrong? isn't the atom to be negated all of this: \(\(unum\)\|\(player\)=\)
naturally just doing: /\(\(unum\)\|\(player\)=\) matches unum= or player=.
When editing an html file in vim, the indentation for css inside style tags is messy.
For instance, this is how it would indent this sample css code without any manual intervention to fix the indentation on my part:
div.class
{
color: white;
backgroung-color: black;
}
Why is this happening? how can I fix it?
I find Vim's undo to be a bit too coarse. E.g. if I type something like this:
a // to go into edit mode
to be or not to ve
<esc> // to exit insert mode
Oops! I made a typo. I want to start undoing so I press u, but then it clears the whole line. Is there a way to undo word-by-word or character-by-character?
Hi,
I am using xdebug plugin for vim. After making few changes i was able to run debugger but not able to set breakpoints.
So, I enabled xdebug.remote_log and below is the log statements corresponding to setting breakpoint.
<- breakpoint_set -i 5 -t line -f file:///C:\htdocs\testLocal.php -n 36
-
Its issuing request to debugger in proper format only but no idea why debugger is returning "command is not avilable".
Please let me know if anything is wrong.
So I've written some code of an assignment and i forgot the universities polocy of
indent with 2spaces.
Normally I'ld have put a:
vim: ts=2:tw=2: et:
at the top of my files, but this time i forgot.
How should I go about replacing all tabs with 2 space?
would
s//
work?
(repalcing and with the respectiove characters.
Ruby 1.9 has a few new syntax elements, such as the {key: value} hash literal syntax. Has anyone written or seen an updated syntax/ruby.vim highlighting file that will highlight key: just like it highlights :key in {:key => value}?
Hello i am using vim and snipMate i very times i need to name the html files to php, just because 1 or 2 lines of code.
I every time i create an php file no introduce html and i have to activate the html snippets manually with the command
set ft=php.html
I intend to activate it automatically in this this line on my vimrc
autocmd BufREad, BufNewFile *.php set ft=php.html
Is this correct? I am missing anything or is something wrong?
Thanks already.
I'm using the following command to auto replace some code (adding a new code segment after an existing segment)
%s/my_pattern/\0, \r some_other_text_i_want_to_insert/
The problem is that with the \r, some_other_text_i_want_to_insert gets inserted right after the new line:
mycode(
some_random_text my_pattern
)
would become
mycode(
some_random_text my_pattern
some_other_text_i_want_to_insert <--- this line is NOT indented
)
instead of
mycode(
some_random_text my_pattern
some_other_text_i_want_to_insert <--- this line is now indented
)
i.e. the new inserted line is not indented.
Is there any option in vim or trick that I can make the newly inserted line indented?
Thanks.
Hi. One frustrating behavior in vim is that when i move my cursor right or left (respectively "l" or "h)" and i am at the end or the beginning of the line, my cursor doesn't move to first column of next line or last column of previous line.
Is there a way to change this behavior ?
:bn , :bp just switches buffers
I want something like ctrl-o, which has a 'stack' of marks it jumps through.
However, I want it to ignore marks in the same file ... i.e
i want ctrl-my-o to be ctrl-o until you hit a different file
and ctrl-my-i to be ctrl-i until you hit a different file
Is there somethig like this in vim?
With vim how do I to turn this:
t.string :crypted_password :null => false
t.string :password_salt, :null => false
into this:
t.string :crypted_password, :null => false
t.string :password_salt, :null => false
without manually adding the spaces to each line?
Hi
How can I add new function names for .c and .h files to be highlighted, similar to this
http://stackoverflow.com/questions/2464593/custumizing-syntax-highlighting-in-vim but much easier? (as I don't need to color words in
different colors, only in the default color for keywords as defined by my theme).
I need this to add highlighting for function names in a project written in C which has a clearly defined API.
Thanks
Similar in appearance to Vim as a note taking platform (SO), I would like a pane with a list of open buffers that can be used as a jump to list. This is one feature in many IDEs and other advanced editors that is missing. Having a dozen buffers or so open becomes confusing as to which buffer is where.
I don't end my JavaScript statements with semicolons when newlines will work. No flames, please. My question is, is there an automatic indentation package for vim that will work?
I downloaded xml.vim (xmledit : A filetype plugin to help edit XML, HTML, and SGML documents ). I placed it in my ftplugins folder. I read the documentation and it says: enter :filetype plugin on but this doesn't work, I'm still unable to make the filetype plugin work. Any suggestions?