the_velour_fog
  • Member for 6 years, 4 months
  • Last seen more than 2 years ago
How can I stop vim automatically inserting a tab in CSS files?
12 votes

I found a couple of ways to solve the problem. 1. reload the buffer after running :filetype indent off Vim's docs (:help :filetype-indent-off) provided an explanation: You can disable :filetype ...

View answer
Prevent vim closing the editor when the last window/splits are help pages
8 votes

using the command :clo[se] instead of :q seems to have solved the problem for me. I.e. if I issue :clo with the above window layout, it causes vim to throw E444: Cannot close last window. In ...

View answer
How can I open a buffer in a new tab leaving the current window and buffer intact?
7 votes

After some research I found a solution. If you are focused on the buffer/window: :tabe % This opens the current buffer in new tab and leaves the current window intact. why does it leave the old ...

View answer
Where is my vim installed?
6 votes

Where is my vim installed? If you installed through apt the following sequence should get you to the Vim installation. From inside Vim, :echo $VIMRUNTIME /usr/share/vim/vim74 You could look in ...

View answer
Using vim diff to compare the working directory to the HEAD in git?
5 votes

To view unstaged modifications to your git working tree in vimdiff, try: git difftool --tool=vimdiff or for staged changes git difftool --tool=vimdiff [ --staged | --cached ] These commands are ...

View answer
When moving text to new line, changes indentation for both lines
5 votes

I would start by checking if you have filetype indent ON, you can check with command: :filetype if you get filetype indent ON in the response, then it means vim has loaded scripts which define ...

View answer
Is it possible to have vim show the list of available marks when using marks?
4 votes

This does exactly what my original question was """""""""""""""""""""""""""" " Ranger style marks command " """""""""""""""""""""""""""" function! Marks() marks echo('Mark: ') " getchar()...

View answer
Generate ctags for bash variables?
Accepted answer
4 votes

based on the prompt from @Cometsong I added wrote the regex expression below and added to my ~/.ctags --regex-sh=/^[ \t]*(local)?[ \t]*([A-Za-z0-9_-]+)=/\2/v,variable,variables/ So far it seems to ...

View answer
How can I get vim-surround to automatically indent surrounded HTML code?
Accepted answer
4 votes

I found a workable solution by changing the following vim core settings. :filetype indent on :set smartindent In my case I was editing an HTML file - which vim had no trouble detecting as the ...

View answer
How can I use marks to jump to locations in files I have recently opened, but not changed?
3 votes

I wrote this vimscript statement which seems to work autocmd BufLeave * :normal ml Explanation BufLeave auto command: this seems to trigger when you move to another window when you close the last ...

View answer
What is the difference between the vimrc files in /etc/vim and /usr/share/vim?
Accepted answer
3 votes

I want to know What is the difference between two vimrc? In the Debian packaged version of vim, /usr/share/vim/vimrc is a symlink to /etc/vim/vimrc - i.e., they are the same file. % ls -al /usr/...

View answer
Delay after selecting item from completion list
3 votes

Thanks to @John O'M for putting me on the right path. The cause of the lag was a plugin I'm using: emmet-vim which provides expansion of special abbreviations into full HTML elements, it creates ...

View answer
How to run a function without getting prompted to continue?
3 votes

After reading this vim.wikia.com article, I learnt that the cause of the prompt is content in the command line exceeding the available commandline height so I added set cmdheight=2 to the function to ...

View answer
How can I indent JavaScript that's within <script> tags in an HTML file?
2 votes

Based on @SatoKatsura's comments, here is a shell script (for UNIX like systems) which will install js-beautify and setup the python executable as a command. Just to clarify, this will install the ...

View answer
Is there a way to insert a path of the file instead of opening it with CtrlP plugin?
2 votes

This is really hacky, but it worked for me, if you source this mapping nnoremap <Leader>pf :let @p=expand("%")<CR>:tabclose<CR>"pp then put your cursor where you want the ...

View answer
Why isn't vim applying syntax highlighting to this code?
1 votes

It turns out it was the tmux terminal detection - obviously beingis fundamental to everything else it seems the terminal state needs to be set right at launch, so launching with vim -N -u NORC -c "...

View answer
Why does vim blink randomly when I'm navigating through code?
1 votes

This could be an issue with vim's system for recognising and then highlighting syntactic "keywords" not getting enough context to recognise keywords. The basic concepts of vim's syntax system (...

View answer
autocmd mark statements causing problems with nerd tree and netrw?
1 votes

per user9433424 comments this is working so far without issues. autocmd BufLeave * :normal! mb autocmd WinLeave * :normal! mw I'm guessing using this command may mean the original functions netrw ...

View answer
How can I define a key mapping which involves a control character?
1 votes

in the end this worked hit :nnoremap enter command line mode hit <space> to put a space between nnoremap and control char about to come hit <C-k> to enter "digraph"? mode see more ...

View answer
How can I save a session in a directory owned by root?
1 votes

Its a bit hacky, so I'd be interested if anyone else has a better answer, but I was able to achieve this inside vim with: :! sudo touch Session.vim :! sudo chown user:user Session.vim :mksession ...

View answer
Why is folding partial disabled in .snippets filetypes?
Accepted answer
0 votes

Yes this is caused by this file in the ultisnips plugin: ~/.vim/bundle/UltiSnips/ftplugin/snippets.vim particularly this block of code: " Set some sane defaults for snippet files if exists('b:...

View answer
How can I rebuild tern_for_vim's index of my code?
0 votes

this is embarrasing, but it seems the failure to update was because my JSDoc code wasnt syntactically correct. Once I fixed my doc comments - the autocomplete hints updated automatically. It seems the ...

View answer