AIX的bash和vim配置文件

bashrc-aix-20110929

export PS1='\a\[\033[30;47m\]\u@\h#\t \[\033[32m\]\w\[\033[30m\] \$\[\033[0m\]\n    '
export PAGER='more'
export MANPATH=${MANPATH}:/data/app1/luoqz/software/man
export HISTFILESIZE=5000
export HISTSIZE=5000

alias cp='cp -i'
alias mv='mv -i'
alias findd="find . -name"
alias ll='ls -lp'
alias ls='ls -p'
alias more='more -i'
alias rm='rm -i'
alias psu="ps -u $USER"
alias psh="ps -u $USER|grep httpd"
alias ipc="ipcs|grep $USER"

lf () { # 输出当前路径下的文件的绝对路径
        echo `pwd`/`ls ${1}`
}
tocpp () { # 根据默认命名规则找到此.h文件相应的.cpp文件名
        echo ${1} | sed 's/\/include\/\(.*\)\.h/\/src\/\1\.cpp/'
}
toh () { # 根据默认命名规则找到此.cpp文件相应的.h文件名
        echo ${1} | sed 's/\/src\/\(.*\)\.cpp/\/include\/\1\.h/'
}


vimrc-aix-20110816


" An example for a vimrc file.
"
" Maintainer:    Bram Moolenaar <Bram@vim.org>
" Last change:    2002 Sep 19
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"          for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"        for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
  finish
endif

" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

if &term =~ "xterm" || &term =~ "vt100" || &term =~ "ansi"
    if has("terminfo")
        set t_Co=8
        set t_Sf=[3%p1%dm
        set t_Sb=[4%p1%dm
    else
        set t_Co=8
        set t_Sf=[3%dm
        set t_Sb=[4%dm
    endif
endif

if has("vms")
  set nobackup        " do not keep a backup file, use versions instead
else
  "set backup        " keep a backup file
endif
set tabstop=4
set shiftwidth=4
set softtabstop=4
set cindent
set history=50        " keep 50 lines of command line history
set ruler        " show the cursor position all the time
set showcmd        " display incomplete commands
set incsearch        " do incremental searching
set ic            " do case insensitive searching
runtime ftplugin/man.vim " using man pages

" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")

" Don't use Ex mode, use Q for formatting
map Q gq

" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependent indenting.
  filetype plugin indent on

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, 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

  augroup END

else

  set autoindent        " always set autoindenting on

endif " has("autocmd")



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 要在 Bash 中运行 Vim 命令并直接打开一个文件进行编辑,可以使用以下命令: ``` vim 文件名 ``` 其中“文件名”是您要编辑的文件的名称。如果该文件不存在,Vim 将创建一个新文件并打开它以供编辑。您可以在 Vim 中对文件进行编辑和保存。要退出 Vim 编辑器并返回到终端,可以按 Esc 键,然后输入“:wq”命令并按回车键。这将保存您所做的更改并退出 Vim。 ### 回答2: Bash是一种常用的shell工具,而Vim是一种文本编辑器,它们可以在Bash中一起使用。 要在Bash中执行Vim命令,需要先在终端中打开一个Bash shell。在终端中输入"vim"命令,然后按下回车键,就可以启动Vim编辑器。 启动Vim后,可以使用各种Vim命令来编辑文本文件。例如,可以使用"i"命令来进入插入模式,这样可以向文件中插入文本。还可以使用"dd"命令来删除一行文本,使用":wq"命令来保存并退出文件。 在Bash中执行Vim命令时,还可以通过输入参数来指定要编辑的文件。例如,可以使用"vim example.txt"命令来打开名为"example.txt"的文本文件进行编辑。 需要注意的是,Vim是一种高度可定制的文本编辑器,有许多配置选项可以设置。可以通过编辑Vim配置文件来定制Vim的行为,例如修改颜色方案、设置编码格式等。在Bash中执行Vim命令时,也可以指定配置文件,通过"-u"参数来加载指定的Vim配置文件。 总而言之,在Bash中执行Vim命令可以帮助用户进行文本编辑工作,使用Vim的强大功能和灵活性来满足不同的编辑需求。 ### 回答3: Bash是一种在Linux和Unix操作系统上常用的命令行工具,它可以执行各种命令和脚本。Vim是一款流行的文本编辑器,也可以在终端中使用。要在Bash中执行vim命令,需要按照以下步骤进行操作: 1. 打开终端:打开Linux或Unix操作系统上的终端应用程序。可以通过搜索终端应用程序的名称或者在任务栏或启动器中找到它。 2. 输入vim命令:在终端中,输入vim命令后,按下空格键,然后输入文件路径和名称。例如,如果要编辑名为“example.txt”的文件,可以输入:vim example.txt。 3. 模式切换:Vim编辑器有多种模式,包括命令模式、插入模式和可视模式。默认情况下,Vim处于命令模式。要切换到插入模式,可以按下键盘上的“i”键。在插入模式下,可以自由编辑文本。 4. 编辑文本:在插入模式下,可以使用键盘输入和编辑文本。可以随意修改文本,添加、删除和移动文本。 5. 退出vim:编辑完成后,可以按下Esc键,切换到命令模式。然后,输入:wq并按下回车键,保存修改并退出vim。 总结:要在Bash中执行vim命令,首先要打开终端,然后输入vim命令,进入vim编辑器并编辑文本,最后保存修改并退出vim

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值