Showing posts with label vim. Show all posts
Showing posts with label vim. Show all posts

Saturday, December 5, 2015

vim setting


Configuration for Vim starts with a vimrc file. It's a text file located by default at ~/.vimrc on Unix  or Linux systems, and $VIM\_vimrc on Windows. If .vimrc doesn't exist, you need to create one.

By default, vim reads /etc/vimrc and ~/.vimrc (the global vimrc and the user-specific one.). For a very old system, the global vimrc was /usr/share/vim/vimrc.
Note: you can put your vimrc into /etc/skel/.vimrc, this will make it available to users you add to the system later. You can also copy the file from /etc/skel/.vimrc to /etc/vimrc and the home directory of users already on the system, like root. Be sure to set permissions, owner, and group if you do copy anything directly from /etc/skel.


a example of a well build of .vimrc setting:
" reset to vim-defaults
if &compatible          " only if not set before:
  set nocompatible      " use vim-defaults instead of vi-defaults (easier, more user friendly)
endif

" display settings
set background=dark     " enable for dark terminals
set nowrap              " dont wrap lines
set scrolloff=2         " 2 lines above/below cursor when scrolling
set number              " show line numbers
set showmatch           " show matching bracket (briefly jump)
set showmode            " show mode in status bar (insert/replace/...)
set showcmd             " show typed command in status bar
set ruler               " show cursor position in status bar
set title               " show file in titlebar
set wildmenu            " completion with menu
set wildignore=*.o,*.obj,*.bak,*.exe,*.py[co],*.swp,*~,*.pyc,.svn
set laststatus=2        " use 2 lines for the status bar
set matchtime=2         " show matching bracket for 0.2 seconds
set matchpairs+=<:>     " specially for html

" editor settings
set esckeys             " map missed escape sequences (enables keypad keys)
set ignorecase          " case insensitive searching
set smartcase           " but become case sensitive if you type uppercase characters
set smartindent         " smart auto indenting
set smarttab            " smart tab handling for indenting
set magic               " change the way backslashes are used in search patterns
set bs=indent,eol,start " Allow backspacing over everything in insert mode

set tabstop=4           " number of spaces a tab counts for
set shiftwidth=4        " spaces for autoindents
set expandtab           " turn a tabs into spaces

set fileformat=unix,dos,mac     " file mode is unix
" only detect unix file format, displays that ^M with dos files

" system settings
set lazyredraw          " no redraws in macros
set confirm             " get a dialog when :q, :w, or :wq fails
set nobackup            " no backup~ files.
set viminfo='20,\"500   " remember copy registers after quitting in the .viminfo file -- 20 jump links, regs up to 500 lines'
set hidden              " remember undo after quitting
set history=50          " keep 50 lines of command history
set mouse=v             " use mouse in visual mode (not normal,insert,command,help mode
                        " in vim 7, you can set mouse=a, so that you can use mouse at any time

" color settings (if terminal/gui supports it)
if &t_Co > 2 || has("gui_running")
  syntax on          " enable colors
  set hlsearch       " highlight search (very useful!)
  set incsearch      " search incremently (search while typing)
endif

" paste mode toggle (needed when using autoindent/smartindent)
map <F10> :set paste<CR>
map <F11> :set nopaste<CR>
imap <F10> <C-O>:set paste<CR>
imap <F11> <nop>
set pastetoggle=<F11>

" Use of the filetype plugins, auto completion and indentation support
filetype plugin indent on

" file type specific settings
if has("autocmd")
  " For debugging
  " set verbose=9

  " if bash is sh.
  let bash_is_sh=1

  " change to directory of current file automatically
  autocmd BufEnter * lcd %:p:h

  " Put these in an autocmd group, so that we can delete them easily.
  augroup mysettings
    au FileType xslt,xml,css,html,xhtml,javascript,sh,config,c,cpp,docbook set smartindent shiftwidth=2 softtabstop=2 expandtab
    au FileType tex set wrap shiftwidth=2 softtabstop=2 expandtab

    " Confirm to PEP8
    au FileType python set tabstop=4 softtabstop=4 expandtab shiftwidth=4 cinwords=if,elif,else,for,while,try,except,finally,def,class
  augroup END

  augroup perl
    " reset (disable previous 'augroup perl' settings)
    au!  

    au BufReadPre,BufNewFile
    \ *.pl,*.pm
    \ set formatoptions=croq smartindent shiftwidth=2 softtabstop=2 cindent cinkeys='0{,0},!^F,o,O,e' " tags=./tags,tags,~/devel/tags,~/devel/C
    " formatoption:
    "   t - wrap text using textwidth
    "   c - wrap comments using textwidth (and auto insert comment leader)
    "   r - auto insert comment leader when pressing <return> in insert mode
    "   o - auto insert comment leader when pressing 'o' or 'O'.
    "   q - allow formatting of comments with "gq"
    "   a - auto formatting for paragraphs
    "   n - auto wrap numbered lists
    "   
  augroup END


  " Always jump to the last known cursor position. 
  " Don't do it when the position is invalid or when inside
  " an event handler (happens when dropping a file on gvim). 
  autocmd BufReadPost * 
    \ if line("'\"") > 0 && line("'\"") <= line("$") | 
    \   exe "normal g`\"" | 
    \ endif 

endif " has("autocmd")


if you configure your vim settings you can store it in ~/.vimrc, or system-wide in /etc/vimrc.local and then by read from the /etc/vimrc file using:

source /etc/vimrc.local
Change Color Scheme:
Open vim and in command mode, type :color , then hit the Tab button instead of Enter to switch between different color. By default, you may see :color blue. If you hit Tab again, you should see :color darkblue. Find a color you think might work for you and hit Enter. 
For the record, I find that the "elflord" color scheme works pretty well in a dark terminal. If your terminal is set to a white background, I like the default scheme or "evening" scheme. (The evening scheme sets a dark background anyway, though.)

Where Colors Live

On Linux Mint, Debian, etc. you'll find the color schemes under /usr/share/vim/vimNN/colors. (Where NN is the version number of Vim, like vim72 or whatever.) But you can also store new color schemes under~/.vim/colors. So if you find something like the Wombat color scheme you can plop that in.
You might also want to take a look at the Vivify tool, which helps you modify color schemes and see the effects. Then you can download the file and create your own scheme.vim.
Now, if you don't want to be setting the color scheme every single time you open Vim, you just need to add this to your ~/.vimrc:
colorscheme oceandeep
It's just that easy.
If you want to create your own color scheme, I recommend using something like Vivify. The actual color scheme files can be very tedious to edit.

VIM QUICK REFERENCE CARD


Basic movement
h l k jcharacter left, right; line up, down
b wword/token left, right
ge eend of word/token left, right
{  }beginning of previous, next paragraph
( )beginning of previous, next sentence
0 gmbeginning, middle of line
^  $first, last character of line
nG nggline n, default the last, first
n%percentage n of the file (n must be provided)
n|column n of current line
%match of next brace, bracket, comment, #define
nH nLline n from start, bottom of window
Mmiddle line of window

Insertion & replace → insert mode
i ainsert before, after cursor
I Ainsert at beginning, end of line
gIinsert text in first column
o Oopen a new line below, above the current line
rcreplace character under cursor with c
grclike r, but without affecting layout
Rreplace characters starting at the cursor
gRlike R, but without affecting layout
cmchange text of movement command m
cc or Schange current line
Cchange to the end of line
schange one character and insert
~switch case and advance cursor
g~mswitch case of movement command m
gum gUmlowercase, uppercase text of movement m
<m >mshift left, right text of movement m
n<< n>>shift n lines left, right

Deletion
x Xdelete character under, before cursor
dmdelete text of movement command m
dd Ddelete current line, to the end of line
J gJjoin current line with next, without space
:rd↵delete range r lines
:rdx↵delete range r lines into register x

Insert mode
^Vc ^Vninsert char c literally, decimal value n
^Ainsert previously inserted text
^@same as ^A and stop insert → command mode
^Rx ^R^Rxinsert content of register x, literally
^N ^Ptext completion before, after cursor
^Wdelete word before cursor
^Udelete all inserted character in current line
^D ^Tshift left, right one shift width
^Kc1c2 or c1←c2enter digraph \c1,c2\
^Ocexecute c in temporary command mode
^X^E ^X^Yscroll up, down
<esc> or ^[abandon edition → command mode

Copying
"xuse register x for next delete, yank, put
:reg↵show the content of all registers
:reg x↵show the content of registers x
ymyank the text of movement command m
yy or Yyank current line into register
p Pput register after, before cursor position
]p [plike p, P with indent adjusted
gp gPlike p, P leaving cursor after new text

Advanced insertion
g?mperform rot13 encoding on movement m
n^A n^X+n, -n to number under cursor
gqmformat lines of movement m to fixed width
:rce w↵center lines in range r to width w
:rle i↵left align lines in range r with indent i
:rri w↵right align lines in range r to width w
!mc↵filter lines of movement m through command c
n!!c↵filter n lines through command c
:r!c↵filter range r lines through command c

Visual mode
v V ^Vstart/stop highlighting characters, lines, block
oexchange cursor position with start of highlighting
gvstart highlighting on previous visual area
aw as apselect a word, a sentence, a paragraph
ab aBselect a block ( ), a block { }

Undoing, repeating & registers
u Uundo last command, restore last changed line
.  ^Rrepeat last changes, redo last undo
n. repeat last changes with count replaced by n
qc qCrecord, append typed characters in register c
qstop recording
@cexecute the content of register c
@@repeat previous @ command
:@c↵execute register c as an Ex command
:rg/p/c↵execute Ex command c on range r
where pattern p matches

Complex movement
- +line up, down on first non-blank character
B Wspace-separated word left, right
gE Eend of space-separated word left, right
n_down n-1 line on first non-blank character
g0beginning of screen line
g^  g$first, last character of screen line
gk gjscreen line up, down
fc Fcnext, previous occurence of character c
tc Tcbefore next, previous occurence of c
; ,repeat last fFtT, in opposite direction
[[ ]]start of section backward, forward
[] ][end of section backward, forward
[( ])unclosed (, ) backward, forward
[{  ]}unclosed {, } backward, forward
[m ]mstart of backward, forward Java method
[# ]#unclosed #if, #else, #endif backward, forward
[* ]*start, end of /* */ backward, forward

Search & substitution
/s↵  ?s↵search forward, backward for s
/s/o↵  ?s?o↵search fwd, bwd for s with offset o
n or /↵repeat forward last search
N or ?↵repeat backward last search
# *search backward, forward for word under cursor
g# g*same, but also find partial matches
gd gDlocal, global definition of symbol under cursor
:rs/f/t/x↵substitute f by t in range r
x: g-all occurrences, c-confirm changes
:rs x↵repeat substitution with new r & x

Special characters in search patterns
.   ^  $any single character, start, end of line
\< \>start, end of word
[c1-c2]a single character in range c1..c2
[^c1-c2]a single character not in range
\i \k \I \Kan identifier, keyword; excl. digits
\f \p \F \Pa file name, printable char.; excl. digits
\s \Sa white space, a non-white space
\e \t \r \b<esc>, <tab>, <↵>, <←>
\= * \+match 0..1, 0..∞, 1..∞ of preceding atoms
\|separate two branches ( ≡ or)
\( \)group patterns into an atom
\& \nthe whole matched pattern, nth () group
\u \lnext character made upper, lowercase
\c \Cignore, match case on next pattern

Offsets in search commands
n or +nn line downward in column 1
-nn line upward in column 1
e+n e-nn characters right, left to end of match
s+n s-nn characters right, left to start of match
;scexecute search command sc next

Marks and motions
mcmark current position with mark c ∈[a..Z]
`c `Cgo to mark c in current, C in any file
`0..9go to last exit position
`` `"go to position before jump, at last edit
`[ `]go to start, end of previously operated text
:marks↵print the active marks list
:jumps↵print the jump list
n^Ogo to nth older position in jump list
n^Igo to nth newer position in jump list

Key mapping & abbreviations
:map c e↵map c ↦ e in normal & visual mode
:map!  c e↵map c ↦ e in insert & cmd-line mode
:unmap c↵  :unmap!  c↵remove mapping c
:mk f↵write current mappings, settings... to file f
:ab c e↵add abbreviation for c ↦ e
:ab c↵show abbreviations starting with c
:una c↵remove abbreviation c

Tags
:ta t↵jump to tag t
:nta↵jump to nth newer tag in list
^] ^Tjump to the tag under cursor, return from tag
:ts t↵list matching tags and select one for jump
:tj t↵jump to tag or select one if multiple matches
:tags↵print tag list
:npo↵  :n^T↵jump back from, to nth older tag
:tl↵jump to last matching tag
^W}  :pt t↵preview tag under cursor, tag t
^W]split window and show tag under cursor
^Wz or :pc↵close tag preview window

Scrolling & multi-windowing
^E ^Yscroll line up, down
^D ^Uscroll half a page up, down
^F ^Bscroll page up, down
zt or z↵set current line at top of window
zz or z. set current line at center of window
zb or z-set current line at bottom of window
zh zlscroll one character to the right, left
zH zLscroll half a screen to the right, left
^Ws or :split↵split window in two
^Wn or :new↵create new empty window
^Wo or :on↵make current window one on screen
^Wj ^Wkmove to window below, above
^Ww ^W^Wmove to window below, above (wrap)

Ex commands (↵)
:e fedit file f, unless changes have been made
:e!  fedit file f always (by default reload current)
:wn :wNwrite file and edit next, previous one
:n :Nedit next, previous file in list
:rwwrite range r to current file
:rw fwrite range r to file f
:rw>>fappend range r to file f
:q :q!quit and confirm, quit and discard changes
:wq or :x or ZZwrite to current file and exit
<up> <down>recall commands starting with current
:r finsert content of file f below cursor
:r!  cinsert output of command c below cursor
:allopen a window for each file in the argument list
:argsdisplay the argument list

Ex ranges
, ; separates two lines numbers, set to first line
nan absolute line number n
.   $the current line, the last line in file
% *entire file, visual area
'tposition of mark t
/p/ ?p?the next, previous line where p matches
+n -n+n, -n to the preceding line number

Folding
zfmcreate fold of movement m
:rfocreate fold for range r
zd zEdelete fold at cursor, all in window
zo zc zO zCopen, close one fold; recursively
[z ]zmove to start, end of current open fold
zj zkmove down, up to start, end of next fold

Miscellaneous
:sh↵  :!c↵start shell, execute command c in shell
Klookup keyword under cursor with man
:make↵start make, read errors and jump to first
:cn↵  :cp↵display the next, previous error
:cl↵  :cf↵list all errors, read errors from file
^L ^Gredraw screen, show filename and position
g^Gshow cursor column, line, and character position
gashow ASCII value of character under cursor
gfopen file which filename is under cursor
:redir>f↵redirect output to file f
:mkview [f]save view configuration [to file f]
:loadview [f]load view configuration [from file f]
^@ ^K ^_  \  Fn ^Fnunmapped keys

Thursday, September 19, 2013

some tricks in vim

1. Editing multiple files
(1) open two files
vim -o file1 file2
will open the files in two windows instead of needing to flip between the files in one window

or:
vim -p foo bar
And traverse the tabs using gt and gT


open another file

open file under cursor                   gf                                    
  (absolute path or relative) 

When you use split to split windows, and you want to get back to original window, type :only
If you want to switch between windows, you can use :C-W C-W or :C-W-j, k, h, l

Cancel a split window, 
The command :hide will hide the currently focused window. I think this is the functionality you are looking for.
if you want to quit the current window, you may use :ZZ or ZQ or :wq

To close all splits, I usually place the cursor in the window that shall be the only visible one and then do:on which makes the current window the on-ly visible window. Nice mnemonic to remember.


Edit: :help :on showed me that these commands are the same:
  • :on
  • :only
  • CTRL-w CTRL-o
  • And yes, also CTRL-W o has the same effect (as Nathan answered).
Each of these four closes all windows except the active one.
While using Vim I'll sometimes want to look at a function definition or a struct definition, so I'll use C-] to jump to it. However, there are a few problems I run into. First off, I don't know how to jump back easily. It appears the previous file I was in closes and I'm now in the new one. Is there a way to jump back, or keep a stack of open files that I can pop back to or something?
Another thing I've noticed that when I have a change in the current file I need to save it because, like a mentioned a moment ago, my current file is being closed before the next one opens.
And sometimes I want to view my current code and my header at once. Is there a way open the tag definition in a split?

set hidden
to you vimrc. It'll allow you switch files without saving them. I think this is one of 'must have' options.
Use C-o to jump back to previous locations which were autosaved in a jumplist.
:h jumplist
To jump back from C-], use C-T. The :tags command shows the current stack.
Set the autowrite option to automatically save what you're doing before jumping to a new file.
Use C-W C-] to open the tag in a new window.
Finally, :help tags is the section in help that explains all this and more.

Another useful feature that comes handy is the uppercase marks. These marks are not local to a buffer and can be used to jump to them from across files. If you mark the line as say "A" using mA command before starting a long and arduous jumping around task, you can finally return back to the original position quickly by typing 'A or `A.

Vim 7 lets you have multiple tabbed pages, and each tab can be split into multiple windows. Vim shows the tabs along the top so you can select them with the mouse.
The commands I use most frequently are:
start vim with the -p option to open each file argument in a new tab.
:tabe <filename> edit a file in a new tab page. If the filename is left out then edit a new buffer.
:tabc closes the current tab page.
:tabo makes this the only tab page by closing all the others.
:tabs lists the tabs
tabdo <cmd> executes a command on every tab page.
gt cycle forward through the tab pages, gT cycles backwards.
See :h tab-page for more information.

Wednesday, September 18, 2013

Installing GuestAdditions and Setup SharedFolder for Ubuntu 12.04 in VirtualBox


Installing GuestAdditions and Setup SharedFolder for Ubuntu 12.04 in VirtualBox


1). Setup Sharedfolder.
this means we need to choose a folder from your host system that you want to share,  and add it to a shared folder list in VirtualBox like this:

2). Install VBoxguestAdditions
The simplest way is to right click on the disk icon on bottom status bar of VirtualBox, choose VBoxGuestAdditions.iso and run. so that it will be installed. after that you should reboot the system.
Also you can do this by:sudo sh /media/cdrom/VBoxLinuxAdditions.run



After reboot, you should be able to see you shared folder is add to this directory(if you folder named abc, here it should be sf_abc. 
add your username to vboxsf group so that you have access to this sf_abc folder.
sudo adduser xxx vboxsf
or 
sudo usermod -aG vboxsf xxx
where xxx is your username, you need to reboot the system so that it can take effect!

since shared folders are always in /media directory, we want to access more easily say we want to access it from desktop, we can achieve this by creating a symbolic link like this:
ln -s /media/sf_dir ~/Desktop/shared_dir
Also, we even want to jump into this directory directly when we start the system, we can achieve this by adding the following line to the end of file: ~/.bashrc 
cd ~/shared_dir
Done!

If we want to install guest additions on a Ubuntu Server, we can do this:

apt-get install --no-install-recommends virtualbox-guest-utils && apt-get install virtualbox-guest-dkms

apt-get install -- no-install-recommends virtualbox-guest-utils
apt-get install virtualbox-guest-dkms
sudo apt-get install build-essential linux-headers-$(uname -r)

Tuesday, September 17, 2013

set up vim

Setting up  vim

On Unix/Linux systems your .vimrc belongs in your home directory. It does not exist by default, you have to create it. At a terminal, Enter your home directory then then:
vim .vimrc
Edit .vimrc file to set up the configurations for Vim.
 The full path to your .vimrc should be in that list.
The Format:
The format of your .vimrc is that it contains Ex commands: anything that you might type in the vim command-line following :, but in your .vimrc, leave off the :.
You've mentioned :set ruler: a .vimrc with only this command looks like:
set ruler
Search for example vimrc and look over the results. This link is a good starting point.

.vimrc should be in your home directory. .vimrc is there to make more interactive according to your need. Here is an example of .vimrc
filetype indent on
set ai
set mouse=a
set incsearch
set confirm
set number
set ignorecase
set smartcase
set wildmenu
set wildmode=list:longest,full
example of .vimrc
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
"              newbie, basing your first .vimrc on this file is a good choice.
"              If you're a more advanced user, building your own .vimrc based
"              on this file is still a good idea.

"------------------------------------------------------------
" Features {{{1
"
" These options and commands enable some very useful features in Vim, that
" no user should have to live without.

" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
set nocompatible

" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on

" Enable syntax highlighting
syntax on


"------------------------------------------------------------
" Must have options {{{1
"
" These are highly recommended options.

" Vim with default settings does not allow easy switching between multiple files
" in the same editor window. Users can use multiple split windows or multiple
" tab pages to edit multiple files, but it is still best to enable an option to
" allow easier switching between files.
"
" One such option is the 'hidden' option, which allows you to re-use the same
" window and switch from an unsaved buffer without saving it first. Also allows
" you to keep an undo history for multiple files when re-using the same window
" in this way. Note that using persistent undo also lets you undo in multiple
" files even in the same window, but is less efficient and is actually designed
" for keeping undo history after closing Vim entirely. Vim will complain if you
" try to quit without saving, and swap files will keep you safe if your computer
" crashes.
set hidden

" Note that not everyone likes working this way (with the hidden option).
" Alternatives include using tabs or split windows instead of re-using the same
" window as mentioned above, and/or either of the following options:
" set confirm
" set autowriteall

" Better command-line completion
set wildmenu

" Show partial commands in the last line of the screen
set showcmd

" Highlight searches (use <C-L> to temporarily turn off highlighting; see the
" mapping of <C-L> below)
set hlsearch

" Modelines have historically been a source of security vulnerabilities. As
" such, it may be a good idea to disable them and use the securemodelines
" script, <http://www.vim.org/scripts/script.php?script_id=1876>.
" set nomodeline


"------------------------------------------------------------
" Usability options {{{1
"
" These are options that users frequently set in their .vimrc. Some of them
" change Vim's behaviour in ways which deviate from the true Vi way, but
" which are considered to add usability. Which, if any, of these options to
" use is very much a personal preference, but they are harmless.

" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase

" Allow backspacing over autoindent, line breaks and start of insert action
set backspace=indent,eol,start

" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set autoindent

" Stop certain movements from always going to the first character of a line.
" While this behaviour deviates from that of Vi, it does what most users
" coming from other editors would expect.
set nostartofline

" Display the cursor position on the last line of the screen or in the status
" line of a window
set ruler

" Always display the status line, even if only one window is displayed
set laststatus=2

" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
set confirm

" Use visual bell instead of beeping when doing something wrong
set visualbell

" And reset the terminal code for the visual bell. If visualbell is set, and
" this line is also included, vim will neither flash nor beep. If visualbell
" is unset, this does nothing.
set t_vb=

" Enable use of the mouse for all modes
set mouse=a

" Set the command window height to 2 lines, to avoid many cases of having to
" "press <Enter> to continue"
set cmdheight=2

" Display line numbers on the left
set number

" Quickly time out on keycodes, but never time out on mappings
set notimeout ttimeout ttimeoutlen=200

" Use <F11> to toggle between 'paste' and 'nopaste'
set pastetoggle=<F11>


"------------------------------------------------------------
" Indentation options {{{1
"
" Indentation settings according to personal preference.

" Indentation settings for using 2 spaces instead of tabs.
" Do not change 'tabstop' from its default value of 8 with this setup.
set shiftwidth=2
set softtabstop=2
set expandtab

" Indentation settings for using hard tabs for indent. Display tabs as
" two characters wide.
"set shiftwidth=2
"set tabstop=2


"------------------------------------------------------------
" Mappings {{{1
"
" Useful mappings

" Map Y to act like D and C, i.e. to yank until EOL, rather than act as yy,
" which is the default
map Y y$

" Map <C-L> (redraw screen) to also turn off search highlighting until the
" next search
nnoremap <C-L> :nohl<CR><C-L>


"------------------------------------------------------------
By default, Nautilus in Ubuntu asks you every time you double-click an executable text file: "Do you want to run <the file>, or display its contents?"
Open Text File Prompt
Open Text File Prompt
In Nautilus go to "Edit --> Preferences".
Preferences in Nautilus
Preferences in Nautilus
On the second tab, Behavior, under Executable Text Files there is a choice toexecute, open, or ask every time. Select the action you want.
Behavior in Preferences
Behavior in Preferences
In my case, I would like to show or open the files automatically, so I chose the second option. I hope this helps.
Of course you could also change the file permissions, but in my case I have several such files copied from older Linux distributions (mainly Freespire), and somehow it always created them this way or made them executable somehow. These settings are for Nautilus, the default file manager in Gnome or Unity desktops, so this should also work for other Ubuntu versions and even other distros.



I have an error in a .vim file, so when I run the command that loads that error, it flashes errors onto the screen for a ms before I can read them. I'd like to pause this display or lengthen the timeout so that I can read them.

With :messages, you can recall previous (error) messages. (But be aware that Vim only keeps the last 200.)




When using opening multiple files with split windows from the command line, vim likes to state what the file names are, the line count, and the character count, for each file. Then the user is prompted to press enter to continue on to the good stuff.
Is there an setting or switch to disable this? I'm using this for diffing with TortoiseSVN and the message is killing my productivity when all I want is a quick glance at the changes.
You have to play with 'shortmess' vim option.
:help shortmess
Either set it in your .vimrc
set shortmess=at
or during the vim run
vim --cmd 'set shortmess=at'

how to install Vim 7.4 from sources, on the Debian based systems
In this article I will show you how to install Vim 7.4 from sources, on the Debian based systems that don’t have a repository for the latest version of Vim available, likeUbuntu 12.10 Quantal Quetzal, Linux Mint 14 Nadia, Debian Wheezy and Debian Squeeze.
Follow this instructions exactly, in order to get a successful installation:
Install the needed dependencies:
$ sudo apt-get install ncurses-dev build-essential mercurial
Clone the sources of Vim 7.4:
$ hg clone https://vim.googlecode.com/hg/ vim
Build Vim from sources:
$ cd vim/src
$ make distclean
$ ./configure --with-features=huge --enable-pythoninterp --enable-rubyinterp
$ make
$ sudo make install
Adjust the PATH: