vim

定时任务备份日志

淺唱寂寞╮ 提交于 2019-12-26 03:46:46
每天晚上23:59备份lampp日志(access_log),备份的文件名以当时的系统时间命名。(备份文件路径:/tmp/logs) 1、编写备份的shell脚本命名为bak_log.sh; (注意用``表示里面是执行的命令,用''表示定义变量;一开始用的'',导致fileName取不到准确的时间值)   vim bak_log.sh                             #新建并编辑 bak_log.sh 脚本   #!/bin/bash                                #指定shell解释器(linux默认的shell解释器是bash)   filePath='/opt/lampp/logs/access_log'                 #定义变量filePath,取需要备份的日志路径   bakPath =' /tmp/logs '                          #定义变量bakPath,取备份日志的路径   fileName=`date +%Y%m%d%H%M%S`               #定义fileName,执行命令取系统时间为文件名   cat $filePath >$ bakPath /access_log_$fileName               #把/opt/lampp

vim之python编辑器打造全攻略

寵の児 提交于 2019-12-25 22:15:17
文章目录 参考的文章 还需注意的几个问题 我的配置 为了简便地在ssh上编辑Python,学习了vim使用及其Python编辑配置,以及在配置过程中出现的一些问题。使用环境是ubuntu Server 18.04 LTS。 参考的文章 这几个人的文章给了我极大的帮助,特别是1和2: 1、再见紫罗兰的 【 使用vim打造自己的python编辑器 】 2、Awakenedy 的 【 Vim与Python真乃天作之合:打造强大的Python开发环境 】 3、weixin_34186128 的 【 在Ubuntu 16.04 LTS 下用Vim 打造自己的Python IDE 问题总结 】自我摸索了很久,搞定了很多坑才发现有这篇文章,早点没发现,浪费了多少时间啊。但是这篇文章中每个代码片段后面都有莫名其妙的数字,删掉即可。 4、54Fire的【 安装YouCompleteMe 】 配置参阅上述文章即可,在此不在赘述 。 还需注意的几个问题 1、本文配置主要是python,其他语言可能有所区别,在查阅资料过程有人提到c++的配置,特别是YouCompleteMe插件有区别。 2、YouCompleteMe建议不要使用Vundle插件管理器 来安装,可先手动安装后再配置。因为youcompleteme实在是太慢了,而且经常断掉。断掉就rm后重来。手动安装请参阅54Fire的【

vim配置

橙三吉。 提交于 2019-12-25 18:16:28
在完成了前面的配置之后,我们的vim应该已经很好用了.不过还是有些问题没有解决.没有自动补全. 这时候就要出马啦. 1. omni complete omni complete是一个很好用的自动补全工具,支持很多语言,能自动的进行一些补全.在编译安装了vim73后,就自带了.我们要在vimrc下打开 set nocp filetype plugin on set ofu=syntaxcomplete#Complete 第一句是关闭兼容模式,第二句则是打开匹配文件类型.一定要加上 打开了之后,就能发现很多代码可以自动补全了.比如css,html等都能很好的工作, 使用方法是<ctrl+x><ctrl+o> 不过这还是不够,对于c/c++程序员来说,我们还需要更强大的工具.类成员变量,类的方法也要补全出来! 所以omnicppcomplete就登场了 下载: http://www.vim.org/scripts/script.php?script_id=1520 cp omnicppcomplete-0.41.zip ~/.vim cd ~/.vim unzip omnicppcomplete-0.41.zip 之后打开vimrc,添加下列几段 " OmniCppComplete set completeopt=menu,longest,menuone let OmniCpp

使用vim编辑python智能提示

Deadly 提交于 2019-12-25 18:15:12
一、vim python自动补全插件:pydiction 可以实现下面python代码的自动补全: 1.简单python关键词补全 2.python 函数补全带括号 3.python 模块补全 4.python 模块内函数,变量补全 5.from module import sub-module 补全 想为vim启动自动补全需要下载插件,地址如下: http://vim.sourceforge.net/scripts/script.php?script_id=850 https://github.com/rkulla/pydiction 安装配置: 1.wget https: //github .com /rkulla/pydiction/archive/master .zip 2.unzip -q master 3.mv pydiction-master pydiction 4.mkdir -p ~/.vim /tools/pydiction 5.cp -r pydiction /after ~/.vim 6.cp pydiction /complete-dict ~/.vim /tools/pydiction 确保文件结构如下: # tree ~/.vim /root/.vim ├── after │ └── ftplugin │ └── python_pydiction

Editing _vimrc in Windows

自古美人都是妖i 提交于 2019-12-25 14:11:38
问题 I am having some trouble with VIM on windows, and I was wondering if anyone could be of assistance. As of right now, I am trying to make it so that when VIM starts, it changes it's working directory to one besides the default (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Vim 7.3) . The way I am going about this is adding in cd $HOME\Desktop\VimFiles , where $HOME is C:\Users\Alphabet (Alphabet is the name of my account). The issue I am running into right now is that after opening up

Editing _vimrc in Windows

懵懂的女人 提交于 2019-12-25 14:11:35
问题 I am having some trouble with VIM on windows, and I was wondering if anyone could be of assistance. As of right now, I am trying to make it so that when VIM starts, it changes it's working directory to one besides the default (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Vim 7.3) . The way I am going about this is adding in cd $HOME\Desktop\VimFiles , where $HOME is C:\Users\Alphabet (Alphabet is the name of my account). The issue I am running into right now is that after opening up

Compiling vim 8.0 with Python 3 support resulting in SIGABRT

核能气质少年 提交于 2019-12-25 10:49:12
问题 I'm having real trouble getting Python 3 working inside vim. I've downloaded the latest 8.0 source from the vim github, and I've been configuring it with this, using the Anaconda distribution including Python 3.6: ./configure \ --with-features=huge \ --enable-multibyte \ --enable-cscope \ --enable-multibyte \ --enable-python3interp=yes \ --with-features=huge \ --with-python3-config-dir=$ANACONDA_PATH/lib/python3.6/config-3.6m-x86_64-linux-gnu \ --enable-fail-if-missing \ --prefix=$LOCAL_BIN

Compiling vim 8.0 with Python 3 support resulting in SIGABRT

北战南征 提交于 2019-12-25 10:47:05
问题 I'm having real trouble getting Python 3 working inside vim. I've downloaded the latest 8.0 source from the vim github, and I've been configuring it with this, using the Anaconda distribution including Python 3.6: ./configure \ --with-features=huge \ --enable-multibyte \ --enable-cscope \ --enable-multibyte \ --enable-python3interp=yes \ --with-features=huge \ --with-python3-config-dir=$ANACONDA_PATH/lib/python3.6/config-3.6m-x86_64-linux-gnu \ --enable-fail-if-missing \ --prefix=$LOCAL_BIN

cannot get SASS (indent style!) syntax highlighting to work in VIM 8

谁说胖子不能爱 提交于 2019-12-25 09:35:10
问题 VIM VERSION: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled May 2 2017 03:55:34) I'm using a number of plugins with vim in order to make things work. I install them via the package manager Vundle, my .vimrc can be found in my dotfiles repository on github Today, I tried to edit a SASS file with vim, however - the SASS file looks like a color-circus: I've followed some steps from this answer which include: Does enabling syntax explicitly fix your problem? :syntax enable Is filetype detection on?

vim-go deleting unused code when write to disk

不打扰是莪最后的温柔 提交于 2019-12-25 07:00:11
问题 I have imported several packages into a file in a Go package ( package commands ) I am writing (following along with a golang tutorial) using Vim with the Vim-Go plugin. Several of these packages are not yet used in the package. When I save the file :w , Vim seems to be deleting the unused packages, which is really annoying because those unused packages are going to be used. I just haven't added the necessary code for them. Is there a way to turn off this functionality in Vim-Go or do I have