vim

第二周 链接文件,vim

一世执手 提交于 2020-01-13 19:08:43
1、描述Linux发行版的系统目录名称命名规则以及用途。 文件命名规则:文件名最长255个字符,包括路径在内文件名最长4095个字节,除了斜杠和NUL,所有字符都有效,但使用特殊字符的目录名不推荐使用,有些字符需要用引号来引用;标准linux文件系统,文件名称大小写敏感。 /bin:二进制程序,普通用户使用 /boot:引导文件存放目录,内核文件(vmlinux)、引导加载器(bootloader,grub)都存放于此目录 /dev:设备文件、特殊文件存放位置 /mnt:临时文件系统挂载点 /opt:第三方应用程序的安装位置 /srv:系统上运行的服务用到的数据 /lib:启动时程序依赖的基本共享库文件以及内核模块文件(/lib/modules) /etc:配置文件目录 /home:用户家目录 /root:root家目录 /sbin:二进制文件,管理员用户使用 /tmp:临时文件 /usr:类似根目录的目录结构 /var:存放可变化的数据 /proc:用于输出内核与进程信息相关的虚拟文件系统 /sys:用于输出当前系统上硬件设备相关信息虚拟文件系统 /selinux:selinux相关的安全策略等信息的存储位置 2、描述文件的元数据信息有哪些,分别表示什么含义,如何查看?如何修改文件的时间戳信息? 元数据信息:文件类型、UID、GID、链接数、该文件的大小和不同的时间戳

Vim: Maintain the history of a file after it has been changed and reloaded

风格不统一 提交于 2020-01-13 14:54:01
问题 If I'm editing a file in Vim, then some external program changes the file, Vim tells me: W11: Warning: File "test.erl" has changed since editing started See ":help W11" for more info. [O]K, (L)oad File: If I L oad the file, though, all the undo history is lost. Is there any way to avoid that? 回答1: Update: it appears that this is one of the new features in Vim 7.3: https://groups.google.com/group/vim_announce/browse_thread/thread/66c02efd1523554b 回答2: I don't believe this is possible. There is

Vim: Maintain the history of a file after it has been changed and reloaded

喜夏-厌秋 提交于 2020-01-13 14:53:10
问题 If I'm editing a file in Vim, then some external program changes the file, Vim tells me: W11: Warning: File "test.erl" has changed since editing started See ":help W11" for more info. [O]K, (L)oad File: If I L oad the file, though, all the undo history is lost. Is there any way to avoid that? 回答1: Update: it appears that this is one of the new features in Vim 7.3: https://groups.google.com/group/vim_announce/browse_thread/thread/66c02efd1523554b 回答2: I don't believe this is possible. There is

Ubuntu 16.04 Vim安装及配置

笑着哭i 提交于 2020-01-13 12:05:06
安装VIM 默认已经安装了VIM-tiny acewu@acewu-computer:~$ locate vi | grep 'vi$' |xargs ls -al lrwxrwxrwx 1 root root 17 12月 9 21:12 /etc/alternatives/vi -> /usr/bin/vim.tiny lrwxrwxrwx 1 root root 20 12月 9 21:13 /usr/bin/vi -> /etc/alternatives/vi -rw-r--r-- 1 root root 59 12月 23 2015 /usr/lib/x86_64-linux-gnu/espeak-data/voices/asia/vi -rw-r--r-- 1 root root 1415 11月 11 2015 /usr/share/bash-completion/completions/ldapvi -rw-r--r-- 1 root root 475 4月 21 2016 /var/lib/dpkg/alternatives/vi 下面我们以Ubuntu14.04(Unity)安装完整版VIM(VIM-basic)为例: 在终端输入以下命令,则会自动安装: sudo apt-get install vim 自动安装完之后,可以使用以下命令进行查看: 已经添加到系统

How to map yank to OS's clipboard in Vim? [duplicate]

筅森魡賤 提交于 2020-01-13 11:11:52
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: vim: copy selection to OS X clipboard While I succeeded to map paste from clipboard ( nmap <leader>p "*p ), the same for yank ( nmap <leader>y "*y ) doesn't seem working. Actually, it yanks in Vim's clipboard. Any idea how to do it properly? I know of clipboard=unnamed but I might keep the old yank/paste vim's commands. EDIT : It seems there is some confusion about my needs. The command "*y works . So there is

Vim: set langmap=e;h breaks supertab plugin

旧时模样 提交于 2020-01-13 09:35:10
问题 I am new to Vim and trying to set up some plugins. So far I have installed pathogen, pyflakes and supertab. The latter does not seem to work; pressing tab while in insert mode simply writes the string <Plug>SuperTabForward . The problem only occurs with the following line in my vimrc (for better navigation using colemak layout): set langmap=hjklneiHJKLNEI;kniejhlKNIEJHL Without the above line it works just fine. After further experiments I've narrowed it down to set langmap=e;h . This single

Vim w/Python: Make “:make” take me to the error

感情迁移 提交于 2020-01-13 08:49:33
问题 If I have a python file like: def Bar(): raise NotImplementedError def Foo(): Bar() if __name__ == '__main__': Foo() And I type :make in vim, it nicely builds me a :cwindow filled with the relevant areas to move up the traceback. However, it defaults my cursor to the first frame of the call (in name == ' main '). Can I somehow change the default behaviour, so it takes me to the actual call of the exception? -- Update -- Answering Ingo's question: :makeprg/errorformat are set to default for

What is the difference between BufRead and BufEnter?

你说的曾经没有我的故事 提交于 2020-01-13 08:40:34
问题 I am confused between the two events BufRead and BufEnter . What is the difference between them? Some example scenarios where I would choose one over the other would be greatly helpful. 回答1: A buffer is the in-memory representation of a file; to edit one, it has to be displayed in a window . The BufRead event is triggered after Vim has read the file into its memory. Unless you reload via :edit! , this only happens once. The BufEnter is fired whenever you activate a certain buffer, i.e. when

文本编辑器vim(2)

不想你离开。 提交于 2020-01-13 08:09:47
vim编辑器 视图模式:(从命令行模式进入视图模式) ctrl+v进入VISUAL BLOCK选中需要注释的行(可视块模式) 1、插入:按shift+i进入编辑模式,输入#,结束按ESC 2、删除:选中内容后,按x或d删除 3、替换:选中需要替换的内容,按下r键,然后输入需要替换的内容( 只能替换单个字符 ;例如选中abcde,替换为aaaaa,不能替换为edcba) 可视行模式: shift+v进入VISUAL LINE选中行内容 1、复制:选中行内容后按y复制 2、删除:选中行内容后按d删除 vim环境变量 环境变量 临时 生效 :set nu:显示行号 :set ic:忽略大小写 :set ai:自动缩进 :set list :显示列表符(空行、tab键) :set no[nu|ic|ai…] 取消临时设定的变量 来源: CSDN 作者: 近乎疯狂的H 链接: https://blog.csdn.net/weixin_43665682/article/details/103843324

How to change tab titles in vim to user-define names?

我怕爱的太早我们不能终老 提交于 2020-01-13 07:14:43
问题 I am using gvim for linux. I got a few tab pages open and a couple of windows open per tab page. I want to change the name of the tab pages to something significant to each project, as they are loaded separately in each tab. Normally tab pages are name after filenames, but I want to change them to specific project names. I tried to use set guitablabel , but it changes all the tabs not only the current one. 回答1: You can try something like this: fun! MyTabLabel() let s:title = gettabvar