English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-12-12 05:01:33 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

yes, it is vim:
alias vi vim

2007-12-12 05:11:30 · update #1

I have tried typing in :
. and
/ and I dont see the last command.
Just an 'echo':
/

2007-12-12 05:15:37 · update #2

I have tried typing in :
. and
/ and I dont see the last command.
Just an 'echo':
/

2007-12-12 05:19:39 · update #3

I have tried typing in :
. and
/ and I dont see the last command.
Just an 'echo':
/

2007-12-12 05:19:40 · update #4

I probably have different settings of vi. I cannot get any of the suggestions below to work in order to get the previous command..

2007-12-12 05:20:48 · update #5

3 answers

Shana

First, you are probably not using vi. More likely vim. And, if you are NOT using vim, get it -- key/macro/etc. compatible with lots of good features.

Try ':ver' to see if you are using VIM.

And, if you are, retrieving previous commands is really easy:

':' up-arrow

Retrieving previous search string:

'/' up-arrow

In both vi and vim, to redo the last command (even after you move the cursor), try '.' (single period key).

VIM, if you aren't already using it, also has an undo stack (vi only allows a single undo).

Hope this helps -- add more detail if you have other questions.

Shana - very strange ?? What version of VIM is it (5.x, 6.x) and what platform (Linux, Solaris, Windows). Are you using "terminal" vim, or gvim?

------

VIM uses 'readline' -- given that you mentioned 'alias' I assume that you are on Linux (or Solaris), and not Windows. Make sure (apt, yum, whichever flavour) that 'readline' is installed.

I don't think its the configuration, but I have posted my .vimrc below. I use this .vimrc on Linux (2.4 kernel, VIM 5, 2.6 kernel with VIM 7, and Solaris 10 with VIM 6), with gvim, and vim (and with a wyse-30 terminal as well):

--> cut <--
" .vimrc

" Terminal switches to underline mode if these are not suppressed.
" Delete line isn't very good either (doesn't work the way terminfo says)
" What is left is the problem that ^F is arrow right.
"if &t_Co <= 2
" set t_ve=
" set t_vs=
" set t_dl=
" set t_kh=
" set t_kr=
" set t_kd=
" set t_ku=
" set t_kl=
"endif
set nocompatible
set backspace=indent,eol,start
set autoindent
set backup
set history=50
set ruler
set number
set noshowcmd
set incsearch
if &t_Co <= 2
set noruler
set noincsearch
set nonumber
endif
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
set mouse=a
endif
if has("autocmd")
filetype plugin indent on
autocmd FileType text setlocal textwidth=78
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif
let b:nroff_is_groff = 1
set shiftwidth=4
set softtabstop=4
set tabstop=8

-->cut<--

All other settings are "defaulted". When you start VIM, use the ':ver' command -- this is what I get:

:ver
VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 25 2006 10:54:57)
Included patches: 1-4, 7-17, 19-26, 29-31, 33-42
Modified by
Compiled by
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile
+python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"

Notice that I have +cmdline_hist. If yours has -cmdline_hist, you won't have the history feature. Some distributions have the option of a "minimal" vim or a full vim. Choose the full vim option, and try it again. Minimal is quite feature reduced! (saves on memory, but even the full version is fine on 128MB machines!).

Hope this additional detail helps.

2007-12-12 05:08:47 · answer #1 · answered by Fred W 5 · 0 0

Try

@

It should pull the last command from the buffer.

2007-12-12 13:12:08 · answer #2 · answered by Mark G 4 · 0 0

Hi. I think you have to create or recall a buffer. Sorry I don't have the details. I think it involves the 'General purpose' buffer.

2007-12-12 13:09:37 · answer #3 · answered by Cirric 7 · 0 0

fedest.com, questions and answers