vim 7.3中的C程序

时间:2014-07-24 06:56:09

标签: vim vi

在大学时我们正在编写一些C代码。我习惯于vim 7.4,但我无法安装它,因为我没有sudo权限。我甚至无法在计算机上保存vimrc,因为它们会在重启后删除所有文件。

所以我的问题是:你如何利用这些障碍进行编程,你带着你的vimrc吗?

另一件令我烦恼的事情是7.3不支持cindent和filetype;所以我只留下了自动注册。我的版本输出:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2013 06:43:40)
Included patches: 1-547
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Small 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 -conceal -cryptv -cscope -cursorbind -cursorshape -dialog -diff -digraphs -dnd
-ebcdic -emacs_tags -eval -ex_extra -extra_search -farsi -file_in_path -find_in_path -float -folding -footer +fork() -gettext -hangul_input +iconv -insert_expand +jumplist -keymap -langmap -libcall -linebreak -lispindent -listcmds
-localmap -lua -menu -mksession -modify_fname -mouse -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse -mouse_xterm -mouse_urxvt +multi_byte -multi_lang -mzscheme -netbeans_intg -path_extra -perl -persistent_undo
-printer -profile -python -python3 -quickfix -reltime -rightleft -ruby -scrollbind -signs -smartindent -sniff -startuptime -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: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DTINY_VIMRC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-z,relro -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo  -lselinux -lacl -lattr

因此,当我编写代码时,它往往看起来像这样:

int main()
{
    int whatever;
    return 0;
    }

按c-d真的感觉就像浪费时间。任何人都有任何建议,也许在vimrc中实现一些我可以随身携带的命令吗?

1 个答案:

答案 0 :(得分:2)

该版本完全不适合编程。以下是最明显缺失的功能:

-autocmd -cindent -clipboard -cmdline_compl -comments -cscope -diff
-eval -ex_extra -extra_search -file_in_path -find_in_path -float -folding
-gettext -insert_expand -modify_fname -lua -path_extra -perl -persistent_undo
-python -python3 -quickfix -reltime -ruby -signs -smartindent -statusline -syntax
-tag_binary -tag_old_static -tag_any_white -tcl -textobjects -user_commands
-vertsplit -virtualedit -visualextra -viminfo -vreplace -wildmenu

您有两种选择:

  • 在本地构建一个合适的Vim,全部包含在特定目录中,并将该目录复制到USB记忆棒上,以便您每天都可以将其放回原处。出于同样的原因,也可以将~/.vim/放在USB记忆棒上。

  • 向您的教授/ IT部门解释/无论您是否真的希望使用该Vim进行编程。