vim

vim, right way to indent css and js inside html

心已入冬 提交于 2019-12-31 02:33:12
问题 Couldn't find proper solution in old questions, so <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <style type="text/css"> body, input{ background-color:red; } </style> <script> function test() { return false } </script> </head> <body> <div></div> </body> </html> everything except code inside <style> and <script> tags indented ok, how can I fix it? 回答1: I use

Linux命令——文件内部命令

余生颓废 提交于 2019-12-30 23:22:47
1、cat 连接并全部显示文件内的信息 -n:在显示的时候可以显示行号,这个行号只是显示出来,跟文件内容没有关系 -E:显示每一行的行结束符,所以linux中文本文件的行结束符是$符 -T:可以显示制表符 -v:显示其他的非打印字符 -A:显示所有的符号 2、more/less more:作用同cat是相同的,只不过这时我们可以通过手动来翻屏,更加方便,more:只支持向后翻,翻到最后就直接退出。 less:显示文件信息,默认不退出显示,q即可退出。 空格:向后翻一屏 b:向前翻一屏 ENTER:向后翻一行 k:向前翻一行 /KEYWORD:查找关键字 3、head/tail head:显示文件的前几行,默认是10行 head -NUM:显示前多少行 tail:显示文件的后几行,默认是10行 tail -NUM:显示后多少行 -f:查看文件尾部且不退出,等待显示后续追加的新内容 。常用于查看日志文件 4、echo 输出信息 echo "abc" ###echo "字符串" | passwd --stdin USERNAME:利用管道修改用户密码 5、输入、输出重定向 输出重定向: 覆盖输出(会覆盖原文件内的内容) 追加输出(不覆盖原文件的内容) set -C :禁止对已经存在文件使用覆盖重定向 set +c :关闭上述功能 2>:重定向错误输出,不能输出正确信息 2>>

Is it possible to yank the entire element without moving to the beginning?

心已入冬 提交于 2019-12-30 22:51:30
问题 When my cursor in middle of a word, and I want to yank the whole word, I must press b first, and press y w to yank it. I want to know can I yank the word without hitting b first? 回答1: y a w is yank around word, meaning if there is a space after the word, it will grab it too (but not a space before). y i w is yank inside word, which yanks just the word characters. You can see what will be yanked by v a w or v i w to select the same characters. You could then also hit y to perform the yank. i

set .vim home directory to something specific

为君一笑 提交于 2019-12-30 18:33:11
问题 My projects are all under /Users/username/workspace/my_project where /Users/username/ is $HOME . I want macvim to always have the home as /Users/username/workspace/my_project instead of /Users/username/ . I understand set autochdir sets the home to whatever the current file's directory is, but this is not what I want. Also I'm using NerdTree if that helps. 回答1: Do you want Vim's working directory to be ~/my_project ? Add cd ~/my_project to your ~/.vimrc . Do you want all your plugins and

VIM Unix commands printed in color

爷,独闯天下 提交于 2019-12-30 18:26:23
问题 I'm using MacVim and I would like to have ! commands printed in color. For example: In bash, the following echo statement prints Hello World in green (as expected): $ echo -e "\033[32m Hello World" Hello World However, in VIM the output is not color, and the escape codes are printed: :!echo -e "\033[32m Hello World" [32m Hello World How can one have VIM (and MacVim build 57 in particular) print the output of ! commands and honour ANSI color escapes. 回答1: You can't. But you can suspend the

shell介绍、history历史命令及配置文件、tab补全、通配符和输出重定向

孤者浪人 提交于 2019-12-30 12:36:10
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 10月11日任务 8.1 shell介绍 8.2 命令历史 8.3 命令补全和别名 8.4 通配符 8.5 输入输出重定向 8.1 shell介绍 什么是shell shell是一个命令解释器,提供用户和机器之间的交互 支持特定语法,比如逻辑判断、循环 每个用户都可以有自己特定的shell CentOS7默认shell为bash(Bourne Agin Shell) 还有zsh/ksh等 8.2 命令历史 history命令 .bash_history 最大1000条 变量HISTSIZE /etc/prefile中修改 #vim /etc/prefile 来修改变量HISTSIZE值 HISTTIMEFORMAT="%Y/%m/%d%H:%M:%S" 永久保存 chattr +a ~/.bash_history !! #表示上一条命令 !n #表示第n条命令 !word #表示执行最后一条word命令 #查看历史命令 [root@centos6 ~]# history #历史命令变量 [root@centos6 ~]# echo $HISTSIZE 1000 #history -c清空内存中的命令历史,但不能修改配置文件 .bash_history里的内容 [root@centos6 ~]# history

VIM配置方案

雨燕双飞 提交于 2019-12-30 11:53:49
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> vim的设置文档是/etc/vimrc,但是一般不建议修改这个文档,而是修改~./vimrc这个文档。~是当前用户的目录。 ''双PIE号表示注释 set hlsearch ''高亮度反白 set backspace=2 ''可随时用倒退键删除 set autoindent ''自动缩进 set ruler ''可显示最后一列的状态 set showmode ‘’左下角那一列的状态 set nu ‘’第一行前面显示行号 set bg=dark ''显示不同的底色色调 syntax on ''进行语法检验,颜色 显示 set tabstop=4 set nobackup set cursorline set nocompatible set smartindent set showmatch set cindent inoremap ( () <LEFT> inoremap { {} <LEFT> inoremap [ [] <LEFT> ------------------------------------------------------------------------------------------------------------------------ 单独使用dd 是 删除一行

vim omnicppcomplete pattern not found

泪湿孤枕 提交于 2019-12-30 11:00:36
问题 I installed vim7.3 on my computer (under windows 7) and i want to use an autocomplete plugin. I searched a lot and found that Omnicppcomplete is the best for that. So i followed this tutorial: Install OmniCppComplete plugin My _vimrc config file looks like this: set nocp filetype plugin on syntax on set filetype=cpp set tags+=C:/Program\ Files/Vim/vimfiles/tags/stl " build tags of your own project with CTRL+F12 "map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR> noremap <F12

Vim settings constantly getting reset

青春壹個敷衍的年華 提交于 2019-12-30 09:53:36
问题 I am using vim inside tmux. For some reason, my vim settings are getting constantly reset. --EDIT-- more detail: specifically, tabstop and autoindent are being set to default values, namely tabstop=8 and noautoindent . I don't think its something in my settings that is setting them to that, because when I type :so $MYVIMRC it resets to the proper values from my vimrc. I think vim is somehow "forgetting" my settings? I haven't been able to figure out exactly what is causing it, but it happens

Why can't I source my vimrc after installing vundle?

做~自己de王妃 提交于 2019-12-30 07:41:40
问题 I'm trying to get my Vim to update on the fly after editing vimrc. So I followed the instructions at Vimcast which basically source vimrc every time you hit save. But that doesn't work for some reason (when I save my vimrc it doesn't give any errors), so I decided to run source $HOME/.vimrc manually and here's what I got: -bash: Configuration file for vim set nocompatible : command not found -bash: Plugin Management { filetype off : command not found -bash: .vimrc: line 7: syntax error near