- Arch Linux
- #1 2018-12-13 12:39:45
- Copying/Pasting from clipboard in vim
- #2 2018-12-13 12:46:30
- Re: Copying/Pasting from clipboard in vim
- #3 2018-12-13 13:12:03
- Re: Copying/Pasting from clipboard in vim
- #4 2018-12-13 13:27:21
- Re: Copying/Pasting from clipboard in vim
- #5 2018-12-13 13:40:43
- Re: Copying/Pasting from clipboard in vim
- #6 2018-12-13 14:15:16
- Re: Copying/Pasting from clipboard in vim
- #7 2018-12-13 14:17:45
- Re: Copying/Pasting from clipboard in vim
- Arch Linux
- #1 2012-05-26 16:45:51
- vim — copy to clipboard without mouse and paste to other application
- #2 2012-05-26 16:54:20
- Re: vim — copy to clipboard without mouse and paste to other application
- #3 2012-05-26 16:57:01
- Re: vim — copy to clipboard without mouse and paste to other application
- #4 2012-05-26 17:02:24
- Re: vim — copy to clipboard without mouse and paste to other application
- #5 2012-05-26 17:04:19
- Re: vim — copy to clipboard without mouse and paste to other application
- #6 2012-05-26 17:34:03
- Re: vim — copy to clipboard without mouse and paste to other application
- #7 2012-05-26 17:39:53
- Re: vim — copy to clipboard without mouse and paste to other application
- #8 2012-05-26 17:41:50
- Re: vim — copy to clipboard without mouse and paste to other application
- #9 2012-05-26 17:49:03
- Re: vim — copy to clipboard without mouse and paste to other application
- #10 2012-05-26 18:06:31
- Re: vim — copy to clipboard without mouse and paste to other application
- #11 2012-05-26 18:10:55
- Re: vim — copy to clipboard without mouse and paste to other application
- #12 2012-05-26 18:18:52
- Re: vim — copy to clipboard without mouse and paste to other application
- #13 2012-05-26 18:20:08
- Re: vim — copy to clipboard without mouse and paste to other application
- #14 2012-05-26 18:39:28
- Re: vim — copy to clipboard without mouse and paste to other application
- #15 2012-05-26 18:45:48
- Re: vim — copy to clipboard without mouse and paste to other application
- #16 2012-05-26 18:54:33
- Re: vim — copy to clipboard without mouse and paste to other application
- #17 2012-05-26 18:55:37
- Re: vim — copy to clipboard without mouse and paste to other application
- #18 2012-05-26 23:33:11
- Re: vim — copy to clipboard without mouse and paste to other application
- #19 2012-07-03 20:26:31
- Re: vim — copy to clipboard without mouse and paste to other application
- Arch linux vim clipboard
- Contents
- Installation
- Usage
- Configuration
- Clipboard
- Syntax highlighting
- Indentation
- Visual wrapping
- Using the mouse
- Traverse line breaks with arrow keys
- Merging files
- Tips and tricks
- Line numbers
- Spell checking
- Saving runtime state
- viminfo files
- Session files
- Saving cursor position
- Replace vi command with Vim
- DOS/Windows carriage returns
- Empty space at the bottom of gVim windows
- Vim as a pager
- Highlighting search results
- Plugins
- Installation
- Using the built-in package manager
- Using a plugin manager
- From Arch repositories
- Notable plugins
- cscope
- Taglist
- Troubleshooting
- gVim is slow
Arch Linux
You are not logged in.
#1 2018-12-13 12:39:45
Copying/Pasting from clipboard in vim
I was wondering how I can copy things outside vim and paste it into vim. I have looked it on the internet and some people have suggested using +y/+P or *y/*P. But neither of them work. Any ideas?
#2 2018-12-13 12:46:30
Re: Copying/Pasting from clipboard in vim
This is how I usually do it:
1. Copy your text (e.g. select text in browser and do CTRL+C)
2. Go to vim and enter INSERT mode
3. Use the paste feature of your terminal emulator (usually CTRL+SHIFT+V or CTRL+ALT+V)
#3 2018-12-13 13:12:03
Re: Copying/Pasting from clipboard in vim
Hello and thanks for the answer. However, the terminal that I have is vim-based only. So those commands do not work
#4 2018-12-13 13:27:21
Re: Copying/Pasting from clipboard in vim
Which version of vim is installed? Afaik you need to install gvim to have relevant support compiled in (even if you just use the command line vim)
#5 2018-12-13 13:40:43
Re: Copying/Pasting from clipboard in vim
Which version of vim is installed? Afaik you need to install gvim to have relevant support compiled in (even if you just use the command line vim)
I use vim v8.1.570. Does gvim override vim or is it like another extension of vi? Also it is pretty surprising that vim does not have such a simple option.
#6 2018-12-13 14:15:16
Re: Copying/Pasting from clipboard in vim
gvim is vim (you can still call it with vim) but with X11 support compiled in, it will for all intents and purposes replace the standard vim package. vim isn’t compiled with X11 support and hence has no ability to access the clipboard.
Last edited by V1del (2018-12-13 14:15:51)
#7 2018-12-13 14:17:45
Re: Copying/Pasting from clipboard in vim
Use xsel in keybindings. For example, I have this in my vimrc to use the ‘insert’ key to paste the content of the primary selection:
I don’t really use the clipboard selection for anything, but for pasting into vim from there you could just add the -b flag to xsel in that binding.
For copying from vim to elsewhere, I rely on the terminal (st in my case) or tmux for that as I can use the mouse to select text and st puts it in the primary selection, or I can use tmux’s copy mode and my tmux.conf is set up to sync the copy buffer to the primary selection. It would be pretty easy also to have vim pass the content of a visual block to a selection via xsel if you wanted that.
Vim can do any of this, but it does none of this out of the box. You need to decide what you want it to do, then put the relevant commands/bindings in your vimrc.
«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman
Источник
Arch Linux
You are not logged in.
#1 2012-05-26 16:45:51
vim — copy to clipboard without mouse and paste to other application
I can copy & paste in editor vim.. andI know copying with mouse.. how to set vim to select all lines and copy them without mouse and paste it to other application like leafpad with Ctrl+V or with «paste» in options? it is possible in vim?
Last edited by xhc (2012-05-26 18:10:31)
#Awesome window manager
#2 2012-05-26 16:54:20
Re: vim — copy to clipboard without mouse and paste to other application
I do it simply using generic Vim’s yanking feature. It should be working if your Vim comes with X support.
:: Registered Linux User No. 223384
#3 2012-05-26 16:57:01
Re: vim — copy to clipboard without mouse and paste to other application
can u pls post what exactly are you doing ?
#Awesome window manager
#4 2012-05-26 17:02:24
Re: vim — copy to clipboard without mouse and paste to other application
Or just bind some key to send the buffer contents to parcellite. Something like
Note: I don’t use parcellite, so I don’t know the proper invocations.
Last edited by Trilby (2012-05-26 17:03:40)
«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman
#5 2012-05-26 17:04:19
Re: vim — copy to clipboard without mouse and paste to other application
Sure: I press v, select the text, than press y, finally paste the snippets in the target application using Ctrl + v (if pasting into Vim, use p).
The crucial parts of my Vim config are ‘+clipboard +xterm_clipboard +X11 ‘.
Oh, and one more thing: in your Parcellite config window, check ‘Use Copy’, ‘Use Primary (Selection)’, ‘Synchronize clipboards’. Nothing else (e.g. special shortcuts) is required.
Edit: thinking right, writing wrong.
Last edited by bohoomil (2012-05-26 17:36:24)
:: Registered Linux User No. 223384
#6 2012-05-26 17:34:03
Re: vim — copy to clipboard without mouse and paste to other application
Hi there!
You can copy from vim to the clipboard saving the yank into the ‘+’ buffer, this is
for yanking to the clipboard and
to paste from the clipboard in vim, so if you just want to copy all text in a file with vim, you can make yourself a macro that contains the following command:
#7 2012-05-26 17:39:53
Re: vim — copy to clipboard without mouse and paste to other application
Parecelite etc. isn’t needed for that.
You have the choise of using either primary selection or clipboard.
For primary selection, you use vim’s visual mode to mark text(not yank it, just mark), and then in whatever other app paste primary selection with ‘shift+ins’.
For clipboard, you need e.g. the gvim package from the arch repo’s, which includes a vim with clipboard support enabled, and then you mark the text and then copy it to clipboard with ‘»+y’, that is ‘double-quote+plus+y’ and then paste in whatever clipboard capable app with ussually ctrl+v.
Finally, you can configure vim to always yank to clipboard(in addition to primary-selection), so you can mark text, press y, and then ctrl+v in whatever clipboard capable app afterwards; to do that add ‘set clipboard=unnamedplus’ to your .vimrc. (note, vim clears whatever it self has placed in the clipboard whenever quiting vim, so keep vim open after you have copied from it and untill after you’ve pasted from it. )
Edit: Beaten by kniren for some of the info
Edit2: Using Primary selection with x11 apps also needs either vim from the gvim package, or a custom built one.
Last edited by mhertz (2012-05-26 19:21:08)
#8 2012-05-26 17:41:50
Re: vim — copy to clipboard without mouse and paste to other application
parcellite is not needed.. I just want to copy all lines in vim (sometimes 20 000 lines) with command Shift + V and Shift + G and SOME COMMAND to clipboard which allows me pasting these lines to web browser for example .
press v, select the text, than press y, finally paste the snippets in the target application using p. — this runs in vim, thats ok, but not ok in other application 🙂
I will try the nmap. hope it will be run
#Awesome window manager
#9 2012-05-26 17:49:03
Re: vim — copy to clipboard without mouse and paste to other application
press v, select the text, than press y, finally paste the snippets in the target application using p. — this runs in vim, thats ok, but not ok in other application 🙂
My bad — see my edit above. You need some app to sync clipboards, IMO. This will let you use Ctrl + c / Ctrl + v and ‘y’ / ‘p’ to copy / paste between vim and other applications simultaneously.
:: Registered Linux User No. 223384
#10 2012-05-26 18:06:31
Re: vim — copy to clipboard without mouse and paste to other application
hmm .. cant pasting into the leafpad for example . it marks, it copy, but only in vim . I have installed vim without other programs.. only basic vim.. and I dont want have gui to vim .-)
Last edited by xhc (2012-05-26 18:06:48)
#Awesome window manager
#11 2012-05-26 18:10:55
Re: vim — copy to clipboard without mouse and paste to other application
I am not sure about your question. I do Ctrl+Insert and everything selected is automatically copied to Parcellite.
#12 2012-05-26 18:18:52
Re: vim — copy to clipboard without mouse and paste to other application
and you select with mouse.. because with mouse it runs. but 20 000lines with mouse?? cant move down with mouse in vim 🙂
#Awesome window manager
#13 2012-05-26 18:20:08
Re: vim — copy to clipboard without mouse and paste to other application
I have installed vim without other programs.. only basic vim.. and I dont want have gui to vim .-)
If so, you have no X11 enabled in your Vim (see the PKGBUILD and compare Vim vs gVim — the latter comes with ‘—with-X=yes’ and that flag you need to have enabled to be able to cross-paste between Vim and other apps).
Just rebuild Vim with the said flag and you should get what you want.
:: Registered Linux User No. 223384
#14 2012-05-26 18:39:28
Re: vim — copy to clipboard without mouse and paste to other application
Yes, rebuild vim, or just simply install gvim, which includes standard vim also, so you do not have to use the gui(I don’t!).
Then afterwards you need to do what me and kniren previously explained. Also, the macro kniren explained was a nice suggestion to save time in the feuture.
Lastly, as I also explained in my last post, then you can also do what you want with standard vim without x11 support compiled in, by using primary selection, allthough I would recommend vim users to get the «full» vim that comes wih gvim, or to build your own «full» version.
Last edited by mhertz (2012-05-26 19:18:02)
#15 2012-05-26 18:45:48
Re: vim — copy to clipboard without mouse and paste to other application
and only different vim — gvim is in this copying to x applications?
#Awesome window manager
#16 2012-05-26 18:54:33
Re: vim — copy to clipboard without mouse and paste to other application
I apologise for my ignorance!
vim compiled without —with-x=yes, also cannot use primary-selection in gui apps!
You don’t need gvim, vim from the gvim package, or custom-built, can also copy/paste to/from X11 apps, and both needs «+y to copy to clipboard(or ‘clipboard=unnamedplus’ in .vimrc), instead of using it’s own internal buffer(s).
Last edited by mhertz (2012-05-26 19:00:14)
#17 2012-05-26 18:55:37
Re: vim — copy to clipboard without mouse and paste to other application
Just for safety reasons, I configure my Vim with three relevant flags: +clipboard +xterm_clipboard +X11 — as I have already mentioned above. The original Vim was not supposed to be used in the X environment, while gVim was. Therefore only one of them comes with X specific features enabled by default. However, it’s possible to reconfigure text-only version of Vim to act like a regular X application, or at least make it able to seamlessly communicate with the X environment and use X resources. I believe if you don’t need GUI and only some features of gVim, recompiling Vim is the a thing to be done.
Edit: just for the reference, the configuration I’ve been successfully using:
Last edited by bohoomil (2012-05-26 18:58:24)
:: Registered Linux User No. 223384
#18 2012-05-26 23:33:11
Re: vim — copy to clipboard without mouse and paste to other application
I find it convenient to work with xsel. See here for how to use it with vim.
I couldn’t be bothered making up new keymappings so I just do it manually: go into visual mode, select the text you want to copy, then type
#19 2012-07-03 20:26:31
Re: vim — copy to clipboard without mouse and paste to other application
Not sure if you found a solution to your issue yet. I use xclip which is very similar to using xsel.
Just install xclip and put the following in your .vimrc but change the and mappings if you like.
Make you selection in vim and press or whatever your mapping is.
Now you can use shift+insert to paste outside of vim or to paste inside a separate running instance of vim.
Minor problem with this solution (or maybe major if you always write you text files on single lines without line breaks) is that it copies all text from the lines selected even if you only select a partial line.
For example if I have a line that says «Copy this line» and I highlight just the word «Copy», the entire «Copy this line» will be pasted. So far not a problem for me since I rarely copy a partial line, but I just thought I would point it out. This problem also occurs when using xsel.
Источник
Arch linux vim clipboard
Vim is a terminal text editor. It is an extended version of vi with additional features, including syntax highlighting, a comprehensive help system, native scripting (Vim script), a visual mode for text selection, comparison of files ( vimdiff(1) ), and tools with restricted capabilities such as rview(1) and rvim(1) .
Contents
Installation
Install one of the following packages:
- vim — with Python 2/3, Lua, Ruby and Perl interpreters support but without GTK/X support.
- gvim — which also provides the same as the above vim package with GTK/X support.
Usage
For a basic overview on how to use Vim, follow the vim tutorial by running either vimtutor (for the terminal version) or gvimtutor (for the graphical version).
Vim includes a broad help system that can be accessed with the :h subject command. Subjects include commands, configuration options, key bindings, plugins etc. Use the :h command (without any subject) for information about the help system and jumping between subjects.
Configuration
Vim’s user-specific configuration file is located in the home directory:
/.vimrc , and Vim files of current user are located inside
/.vim/ . The global configuration file is located at /etc/vimrc . Global Vim files such as defaults.vim and archlinux.vim are located inside /usr/share/vim/ .
For gVim, the user-specific configuration file is located at
/.gvimrc and the global configuration file is located at /etc/gvimrc .
/.vimrc is present. Add let skip_defaults_vim=1 to /etc/vimrc to disable loading of defaults.vim completely. [1]. Alternatively, to enable defaults.vim even when
/.vimrc is present, see :h defaults in vim.
Clipboard
Vim commands such as :yank or :paste operate with the unnamed register, which by default corresponds to the «* register. If the +clipboard feature is available, the «* register is reflected to the PRIMARY buffer in X.
To change the default register, you can :set clipboard=unnamedplus to use the «+ register instead. The «+ register corresponds to the CLIPBOARD buffer in X.
For more information, see :help ‘clipboard’ .
Syntax highlighting
To enable syntax highlighting for many programming languages:
Indentation
This article or section needs expansion.
The indent file for specific file types can be loaded with:
Visual wrapping
The wrap option is on by default, which instructs Vim to wrap lines longer than the width of the window, so that the rest of the line is displayed on the next line. The wrap option only affects how text is displayed, the text itself is not modified.
The wrapping normally occurs after the last character that fits the window, even when it is in the middle of a word. More intelligent wrapping can be controlled with the linebreak option. When it is enabled with set linebreak , the wrapping occurs after characters listed in the breakat string option, which by default contains a space and some punctuation marks (see :help breakat ).
Wrapped lines are normally displayed at the beginning of the next line, regardless of any indentation. The breakindent option instructs Vim to take indentation into account when wrapping long lines, so that the wrapped lines keep the same indentation of the previously displayed line. The behaviour of breakindent can be fine-tuned with the breakindentopt option, for example to shift the wrapped line another four spaces to the right for Python files (see :help breakindentopt for details):
Using the mouse
Vim has the ability to make use of the mouse, but it only works for certain terminals:
To enable this feature, add this line into
The mouse=a option is set in defaults.vim .
Traverse line breaks with arrow keys
By default, pressing ← at the beginning of a line, or pressing → at the end of a line, will not let the cursor traverse to the previous, or following, line.
The default behavior can be changed by adding set whichwrap=b,s, ,[,] to your
Merging files
Vim includes a diff editor (a program that shows differences between two or more files and aids to conveniently merge them). Use vimdiff to run the diff editor — just specify some couple of files to it: vimdiff file1 file2 . Here is the list of vimdiff-specific commands.
Action | Shortcut |
---|---|
next change | ]c |
previous change | [c |
diff obtain | do |
diff put | dp |
fold open | zo |
fold close | zc |
rescan files | :diffupdate |
Tips and tricks
Line numbers
To show the line number column, use :set number . By default absolute line numbers are shown, relative numbers can be enabled with :set relativenumber . Setting both enables hybrid line numbers—the current line is absolute, while the others are relative.
Jumping to a specific line is possible with :line number or line numbergg . Jumps are remembered in a jump list, see :h jump-motions for details.
Spell checking
Vim has the ability to do spell checking, enable by entering:
By default, only English language dictionaries are installed. More dictionaries can be found in the official repositories by searching for vim-spell . Additional dictionaries can be found in the Vim’s FTP archive. Additional dictionaries can be put in the folder
/.vim/spell/ and enabled with the command: :setlocal spell spelllang=en_us (replacing the en_us with the name of the needed dictionary).
Action | Shortcut |
---|---|
next spelling | ]s |
previous spelling | [s |
spelling suggestions | z= |
spelling good, add | zg |
spelling good, session | zG |
spelling wrong, add | zw |
spelling wrong, session | zW |
spelling repeat all in file | :spellr |
/.vimrc or /etc/vimrc , and then restart Vim.
You can enable spell checking for arbitrary file types (e.g. .txt) by using the FileType plugin and a custom rule for file type detection. To enable spell checking for any file ending with .txt, create the file /usr/share/vim/vimfiles/ftdetect/plaintext.vim , and insert the line autocmd BufRead,BufNewFile *.txt set filetype=plaintext into that file. Next, insert the line autocmd FileType plaintext setlocal spell spelllang=en_us into your
/.vimrc or /etc/vimrc , and then restart Vim. Alternatively, one can simply insert the line autocmd BufRead,BufNewFile *.txt setlocal spell into their
/.vimrc or /etc/vimrc , and then restart Vim. Be sure to edit this line (specifically *.txt ) to include the filetype(s) intended for spell checking.
To enable spell checking for LaTeX (or TeX) documents only, add autocmd FileType tex setlocal spell spelllang=en_us into your
/.vimrc or /etc/vimrc , and then restart Vim.
Saving runtime state
Normally, exiting vim discards all unessential information such as opened files, command line history, yanked text etc. Preserving this information can be configured in the following ways.
viminfo files
The viminfo file may also be used to store command line history, search string history, input-line history, registers’ content, marks for files, location marks within files, last search/substitute pattern (to be used in search mode with n and & within the session), buffer list, and any global variables you may have defined. For the viminfo modality to be available, the version of vim you installed must have been compiled with the +viminfo feature.
Configure what is kept in your viminfo file, by adding (for example) the following to your
where each parameter is preceded by an identifier:
See the official viminfo documentation for particulars on how a pre-existing viminfo file is modified as it is updated with current session information, say from several buffers in the current session you are in the process of exiting.
Session files
Session files can be used to save the state of any number of particular sessions over time. One distinct session file may be used for each session or project of your interest. For that modality to be available, the version of vim you installed must have been compiled with the +mksession feature.
Within a session, :mksession[!] [my_session_name.vim] will write a vim-script to my_session_name.vim in the current directory, or Session.vim by default if you choose not to provide a file name. The optional ! will clobber a pre-existing session file with the same name and path.
A vim session can be resumed either when starting vim from terminal:
Or in an already opened session buffer by running the vim command:
Exactly what is saved and additional details on session files options are extensively covered in the vim documentation. Commented examples are found here.
Saving cursor position
Replace vi command with Vim
Create an alias for vi to vim .
Alternatively, if you want to be able to type sudo vi and get vim , install vi-vim-symlink AUR which will remove vi and replace it with a symlink to vim . You could also create this symlink yourself and place it somewhere higher in your path than /usr/bin to have it take precedence.
DOS/Windows carriage returns
If there is a ^M at the end of each line then this means you are editing a text file which was created in MS-DOS or Windows. This is because in Linux only a single line feed character (LF) used for line break, but in Windows/MS DOS systems they are using a sequence of a carriage return (CR) and a line feed (LF) for the same. And this carriage returns are displayed as ^M .
To remove all carriage returns from a file do:
Note that there ^ is a control letter. To enter the control sequence ^M press Ctrl+v,Ctrl+m .
Alternatively install the package dos2unix and run dos2unix file to fix the file.
Empty space at the bottom of gVim windows
When using a window manager configured to ignore window size hints, gVim will fill the non-functional area with the GTK theme background color.
The solution is to adjust how much space gVim reserves at the bottom of the window. Put the following line in
Vim as a pager
Using scripts Vim can be used as a terminal pager, so that you get various vim features such as color schemes.
Vim comes with the /usr/share/vim/vim82/macros/less.sh script, for which you can create an alias. Note that this script does not support any command-line flags mentioned in less(1) § OPTIONS .
Alternatively there is also the vimpager Vim script. To change the default pager, export the PAGER environment variable. Note that not all command-line flags are supported; the list of supported flags is available on GitHub.
Highlighting search results
In order to highlight the first string that will be matched in a search while typing the search, add the following line to your
In order to highlight all strings that will be matched in a search while typing the search, and after the search has been executed, add the following line to your
Plugins
Adding plugins to Vim can increase your productivity by extending Vim’s features. Plugins can alter Vim’s UI, add new commands, enable code completion support, integrate other programs and utilities with Vim, add support for additional languages and more.
Installation
Using the built-in package manager
Vim 8 added the possibility to load third-party plugins natively. This functionality can be used by storing third-party packages in the
/.vim/pack folder. The structure of this folder differs slightly from that of typical plugin managers which will usually have a single directory per plugin. What follows is a typical installation procedure and directory structure (using Tim Pope’s vim-surround plugin as an example):
It is important to note that
/.vim/pack/tpope is a package directory which is loosely defined as directory containing one or more plugins in the Vim documentation. Plugin repositories should not be downloaded to this directory though. The name of the package directory is also arbitrary. You can choose to keep all your plugins in a single package directory or, as in our example, use the author’s GitHub name, tpope .
The package directory can contain the following subfolders:
- start — plugins from this subfolder will be loaded automatically when Vim starts. This is the most frequently used location.
- opt — plugins from this subfolder can be loaded on-demand by issuing :packadd command inside Vim.
Now change into the start folder and checkout the plugin repository:
This creates an additional subfolder,
/.vim/pack/tpope/start/surround , where the plugin files are placed.
Next, update the help index if the plugin contains help files:
The plugin will now be loaded automatically when starting Vim. No changes to
/.vimrc are required, barring plugin-specific options.
Using a plugin manager
A plugin manager is a plugin that installs, manages and updates Vim plugins. This can be useful if you are also using Vim on platforms other than Arch Linux and want a consistent method of updating plugins.
- Vim-plug is a minimalist Vim plugin manager with many features like on-demand plugin loading and parallel updating, available as vim-plugAUR or vim-plug-gitAUR .
- Vundle is available as vundleAUR or vundle-gitAUR .
- pathogen.vim is a simple plugin for managing Vim’s runtimepath, available as vim-pathogenAUR or vim-pathogen-gitAUR .
- Dein.vim is a plugin manager replacing NeoBundle, available as vim-deinAUR or vim-dein-gitAUR .
From Arch repositories
The vim-plugins group provides various plugins. Use pacman -Sg vim-plugins command to list available packages which you can then install with pacman.
Notable plugins
cscope
Cscope is a tool for browsing a project. By navigating to a word/symbol/function and calling cscope (usually with shortcut keys) it can find: functions calling the function, the function definition, and more.
Copy the cscope default file where it will be automatically read by Vim:
/.vim/plugin/cscope_maps.vim in order to enable cscope shortcuts in Vim 7.x:
Create a file which contains the list of files you wish cscope to index (cscope can handle many languages but this example finds .c, .cpp and .h files, specific for C/C++ project):
Create database files that cscope will read:
Default keyboard shortcuts:
Feel free to change the shortcuts.
Taglist
Taglist provides an overview of the structure of source code files and allows you to efficiently browse through source code files in different programming languages.
Useful options to be put in
Troubleshooting
gVim is slow
Vim’s GTK 3 GUI may be slower than the GTK 2 version (see FS#51366). gvim-gtk2 AUR can be installed as a workaround.
Источник