I really like text highlighting in Vim for searches and Shift-8. Is there anyway to enable it in VsVim on VS 2010 or VS 2012?
I added a .vsvimrc file into my user home directory i.e. C:\Users\joe.bloggs that contains the following command:
:set hlsearch
which is the regular Vim highlight search option.
Related
I want to highlight the search keyword in Vim. Mainly I use vim to debug the logs.
I always have to use :se hlsearch to highlight the search keyword.
So, I want the solution that it should set command permanently, and I should not use the command always when vim starts.
Set the command in .vimrc.
Use the following commands:
Open ~/.vimrc file (or create it if it didn't exist).
Add set hlsearch in the file.
Save the file.
Now your search will always be highlighted in vim.
For single time use, just use :set hlsearch in vim, which will be in effect for that instance only.
If you want to highlight multiple searches (in parallel, with different colors), check out my Mark plugin; it also allows to persist the highlightings across Vim sessions through the viminfo file; cp. :help mark-persistence.
For those wanting to visually keep highlighted their search:
:syn match stupid "ctrl + /"
:hi stupid ctermbg=Red guibg=Red
Explanation:
The first line add your regex to a syntax type called "stupid" (note that ctrl + / means you must press ctrl+R then / to get the content of the search registry).
The second line gives a red color to the "stupid" syntax regex.
My SelX plugin allows you to highlight and search for many different things at once on a per-tab basis, with different colours. The highlight config can be saved to a vim session
https://www.vim.org/scripts/script.php?script_id=5875
I'm using Vim in a terminal on my MacBook Air with OS X Lion, and I can't seem to find a good plugin for Markdown syntax highlighting.
So far I've tried the plasticboy plugin and Tim Pope's plugin. The plasticboy plugin worked OK but was causing white space at the end of lines to be highlighted, and I haven't figured out how to turn that off. (It's really annoying, because every time I hit space when I'm writing it highlights the character.)
Tim's plugin didn't seem to do very much in the way of highlighting, other than maybe headers that use ###. Code blocks and bullets are ignored. I might be missing something there. I do use the .md extension on my Markdown files, so it should be picking up the filetype.
I've also seen a reference to Vim 7.3 having Markdown support built in, but without one of those two plugins I don't get any highlighting at all.
Do either of these require specific color schemes to work?
About the native syntax highlight for markdown I think it only works for files with the extension .markdown by default.
I was having problems with markdown syntax highlight for my .md files.
I tried:
:set syntax=markdown
And it worked.
So i included the following line in my .vimrc:
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
Now my vim have syntax highlight for my .md files.
BufFilePre is needed for :sav
Native syntax highlighting
Native syntax highlighting for Markdown only works by default for the .markdown file extension.
The following line in .vimrc yields the best results for both vim and gvim:
autocmd BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc
Explanation:
1. Specify your Markdown flavour!
If you work with mainly one flavour of Markdown (e.g. Pandoc), be sure to mention this as well! Doing so, allows for mixing and matching of both Markdown- and Pandoc-specific Vim plug-ins. For example: I have found the vim-pandoc-syntax plug-in particularly suitable for my highlighting needs. Nevertheless, I use the more general vim-markdown-folding for Markdown folding.
By the way, only one flavour is allowed, separated by a dot, e.g.: filetype=markdown.pandoc
2. gvim requires BufFilePre
gvim requires an additional BufFilePre in the autocommand line for Markdown file type recognition with the Save As… :sav command.
This should work to disable the end-of-line space highlighting when using the plasticboy mkd plugin:
:syn clear mkdLineBreak
You could autocmd that for the necessary file extensions so that you needn't do it every time you load a markdown file.
Note that this specific highlight exists because Markdown treats lines ending with 2 or more space characters specially by inserting a <br>, so it is useful.
The plasticboy plugin uses TODO highlighting for this rule, which is a bit too much as it's designed to, by default, be really garish - yellow background - so that it stands out. You can make this less visually striking by changing that highlight rule. One quick way to do this would be something like:
:hi link mkdLineBreak Underlined
Now those end-of-line spaces will show up as underlined. Try linking to other highlight groups for something that may appeal to you more. Instead of using link you can get even more specific about those end-of-line spaces: for instance you could specify that they show up as just slightly lighter/darker than the normal background, using your own highlight command, specifying custom ctermfg, ctermbg, guifg, guibg settings.
As above, you could autocmd this to apply your specific settings.
For more information about link highlight groups, type: :help group-name and you'll see a list of groups that can be linked that themselves should helpfully be displayed using their current highlight rules. Also: :help highlight.
In Tim's plugin the .md extension works only for README.md because filetype.vim specifies so.
" Markdown
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,README.md setf markdown
If you don't like putting all of your configuration in ~/.vimrc, you can create ~/.vim/ftdetect/markdown.md (or its equivalent on Windows) with the following contents.
au BufNewFile,BufRead *.md setf markdown
Like Visual Studio when you type-in a tooltip shows you the summary (documentation) of lib/objects/functions etc.
Suppose, I'm experimenting with DataMapper. I would like to see what it has and what each of them can do (purpose) without leaving vim. Is this possible?
Although I'm doing PHP development, not Ruby, I think this will also work for Ruby:
For PHP (Drupal) I generate a tags file with ctags and configure vim to use this tagfile by setting the tags-option. (see :help tags).
Now when I start typing a function-name I can press CTRL-X CTRL-O to start Omnicompletion. Vim show a list of all possible completions and you can select next/previous suggestions with CTRL-N and CTRL-P. When selecting a completion Vim also shows the function declaration in a preview window.
You can close the preview window with the :pclose-command.
The preview will only show up if the completeopt-settings contains the preview value (see :help 'completeopt')
I always use putty to connect to Linux machines. I really want to make the Tabs in file visible in Vim.
I can have the Tabs highlighted in Gvim with the scripts below.
syntax match Tab /\t/
hi Tab gui=underline guifg=blue ctermbg=blue
However Vim with Putty, it doesn't work. I try to change gui to cterm, guifg to ctermfg. But still not work.
I know there is other way to make Tabs visible like the scripts below. The tabs will be displayed with ">----". However I don't prefer this way.
set lcs=tab:>-
set list!
Do you guys know any way to highlight Tabs with color in Vim on Putty?
set list allows you to see invisible characters, including tabs.
I added this stuff to my vimrc so that the characters look nicer:
set listchars=tab:▸\ ,eol:¬
The spacehi.vim plugin works for me in Putty connecting to a Linux machine.
The ctermfg and ctermbg options take a color number, not an English color name. Try 9. The table of numbers and their usual meanings is in vim's online help :help ctermfg
A workaround solution is if you do not prefer separate plugin..
Add the following scrpts in .vimrc:
function! HiTabs()
syntax match TAB /\t/
hi TAB ctermbg=blue ctermfg=red
endfunction
au BufEnter,BufRead * call HiTabs()
This will highlight all tabs even in vim help files....
Suggest use spacehi.vim.
Search for the tab special character
/\t
Also make sure Search Highlighting is enabled
:set hlsearch
I am fairly new to vim. I am trying to practice (been reading a couple of tutorials lately) but I found out I couldn't live without highlighting characters/words/lines for Copy-paste.
In Textmate, I usually SHIFT+CTRL+LeftArrowKey to highlight words and then Copy.
How do I do that in VIM?
NOTE: I have NERDTree plugin installed and mapped some keys for my own consumption.
Give a look to the Vim Visual Mode.
The Shift+Ctrl+LeftArrowKey for word highlighting can be replaced easily for vw or vb.
Highlighting lines :
V to enter in Visual Line mode, then you can move with j,k, Ctrl-U, Ctrl-D, etc...
The Visual Mode is very powerful and useful.
Also, give a look to my answer to this question.
I am using VIM on Windows right now and in my .vimrc I have the following:
if has("win32")
set clipboard=unnamed "always copy into clipboard
set go+=a " when I am selecting anything, it is autamtically copied
" into clipboard
endif
I don't have any Linux machine right now with me, but I think, that it should work on Linux too. (maybe it will require some hacking)
Edit
There are lots of usefull tips about yanking(copying) here: Vim Wikia