vim

vim配置和安装插件

拟墨画扇 提交于 2020-01-22 16:19:35
参考链接: https://blog.csdn.net/sjin_1314/article/details/85041335 我的系统为Centos 7 .2 1、安装Vim: yum install vim 2、安装 Vundle 在github上下载Vundle,保存目录在~/.vim/bundle/vundle路径下,需要自己配置.vimrc及.vimrc.bundles(插件设置) git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim ~/.vimrc 添加如下内容: set syntax=on set nu set ts=4 set sw=4 set tags=tags; set autochdir set hlsearch set cc=80 set encoding=utf-8 set expandtab set autoindent set foldlevel=99 set foldmethod=indent if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles endif vim ~/.vimrc.bundles添加如下内容 set nocompatible " be

How to send escape sequences from within Vim?

无人久伴 提交于 2020-01-22 15:20:20
问题 So recently Apple have included support for displaying the working directory and file in the status bar of Terminal. The escape sequence that must be sent (to set the current file) is this: ESC ] 6 ; Pt BEL where Pt is a file:// url pointing to the file currently being edited. So I figured I could get Vim to send this command as an escape sequence, but I'm having a bit of trouble. I have this so far: au BufNewFile,BufReadPost,BufFilePost,BufWritePost * echo <escape sequence> but I have a

“Minimizing” vertical VIM window splits

↘锁芯ラ 提交于 2020-01-22 14:11:09
问题 I use horizontal and vertical window splits in religiously in VIM and up until recently, I enjoyed the comfort of two commands to effectively hide (or minimize) my horizontal splits. I set them up adding the following lines to my .vimrc file: set winminheight=0 map <C-J> <C-W>j<C-W>_ map <C-K> <C-W>k<C-W>_ Hitting Control-j or Control-k navigates through horizontal splits by going up or down. What I'd like to accomplish is the same thing for vertical splits by showing or hiding the left or

How do I launch an editor from a shell script?

点点圈 提交于 2020-01-22 06:57:38
问题 I would like my tcsh script to launch an editor (e.g., vi, emacs): #!/bin/tcsh vi my_file This starts up vi with my_file but first displays a warning "Vim: Warning: Output is not to a terminal" and my keystrokes don't appear on the screen. After I kill vi, my terminal window is messed up (no newlines), requiring a "reset". I tried "emacs -nw", "xemacs -nw", and pico with similar results. "xemacs" works but launches a separate window. I want to reuse the same terminal window. Is there a way to

Please explain Vim's configuration directories hierarchy

╄→尐↘猪︶ㄣ 提交于 2020-01-22 04:51:26
问题 I am trying to update my Vim configuration scripts. There are a number of sub-directories in my ~/.vim directory and I'm not sure the specifics of what they do, nor why there are some that seem to be redundant. Here is what my ~/.vim directory tree looks like |-after |---ftplugin |---syntax |-autoload |-compiler |-doc |-ftplugin |---latex-suite |-----dictionaries |-----macros |-----packages |-----templates |---python |-indent |-plugin |-spell |-syntax Now for the specific questions. What goes

类似vim中lookupfile的emacs插件---globalff

岁酱吖の 提交于 2020-01-22 03:58:56
  我是先学Vim后学Emacs的。本人并对这两大神器并没有明显的偏向,自己开发机上个两个都有装,两个都有实战的项目。所以无论你是Vimer还是Emacser,都请不要对我口诛笔伐。如果非要我说个取向,定个说法的话,我会说:SSH连到服务器上,服务器系统默认什么用什么,入乡随俗。其实,如果默认的是Notepad++我也是会用的。   回过头来说正题,这实质上是我刚开始学Emacs时的问题,那将近8年前的事了。当时在百度上查到了如下这个贴子: emacs有没有类似vim的lookupfile插件的功能? https://forum.ubuntu.org.cn/viewtopic.php?t=188897 应该说,贴子中提及的插件,我都试了都是比较有用的插件,例如,ido插件能让buffer的查找速度暴增。问题是这些插件的设计的理念与lookupfile并不相同。所以从该贴吧我并不能直接找到类似lookupfile的emacs插件。后来自己找到的可行解决方法是: M-x shell locate [部分文件名] M-x ffap 虽然用起来麻烦一些,但基本满足了查找文件需求。所以就一直用了下来。2020年农历新年快到了,我检视一下自己的Emacs插件库,发现lookupfile的替代插件这一栏都已经留了多年,一直都没有填上。我反思

Hadoop介绍和环境搭建

本秂侑毒 提交于 2020-01-22 02:45:45
# 1.首先安装一台centos7(4G+40G+NAT+最小安装+管理员密码设置为root),并复制三份,分别重命名为node01,node02,node03. 标题 标题 # 2。其次分别对 node01,node02,node03 三台主机进行如下配置 # 将网卡配置文件最后一行的 ONBOOT=no 修改为 ONBOOT=yes [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33 ONBOOT=yes [root@localhost ~]# service network restart Restarting network (via systemctl): [ OK ] [root@localhost ~]# yum -y install net-tools wget vim zip unzip lrzsz [root@localhost ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.150.128 netmask 255.255.255.0 broadcast 192.168.150.255 inet6 fe80::6841:a8ff:9497:3fed

python vim 自动补全

好久不见. 提交于 2020-01-21 22:23:36
mkdir -pv ~/.vim/bundle cd ~/.vim/bundle git clone https://github.com/rkulla/pydiction.git cp -r ~/.vim/bundle/pydiction/after/ ~/.vim echo 'filetype plugin on' > ~/.vimrc echo 'let g:pydiction_location = "~/.vim/bundle/pydiction/complete-dict"'>> ~/.vimrc echo 'let g:pydiction_menu_height = 3' >> ~/.vimrc 来源: CSDN 作者: 如醒似梦 链接: https://blog.csdn.net/qq_30945363/article/details/104064229

How to ensure that formatoptions *never* contains `r` or `o`?

帅比萌擦擦* 提交于 2020-01-21 19:17:57
问题 In vim , the filetype occasionally is set to a value that auto-populates formatoptions with r and o , two features that I do not like. What setting can I add to guarantee that under no circumstances will those characters appear in formatoptions? 回答1: Modifying @sergio's answer slightly, you could use autocmd Filetype * set fo-=r fo-=o in your vimrc. This removes 'r' and 'o' from 'formatoptions' whenever the filetype is set. (Note that filetype detection has to be on, which can be set by

How can I undo all changes to a block of text in vim?

馋奶兔 提交于 2020-01-21 11:48:28
问题 Is it possible to select some text with visual line and undo all changes made to it from the beginning ? 回答1: I actually do that by undoing everything yanking the block then redoing everything to the last modification and then replacing the block with the yanked text. 来源: https://stackoverflow.com/questions/2236099/how-can-i-undo-all-changes-to-a-block-of-text-in-vim