vim

How to use cscope?

不想你离开。 提交于 2019-12-20 19:40:06
问题 I am using cscope to get familiar with all the keywords used in socket programming. I went to the directory with c files. I used cscope. and then I searched for AF_INET. I got this : #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 This was a full page. I only published part of it. Now I want to know from where this PF_INET is coming? what command I should use. I have seen a guy to double click on PF_INEt and using some command to find it. I don't know what the command

Useful customizations in .ideavimrc

萝らか妹 提交于 2019-12-20 19:08:51
问题 I'm interested in hearing how some of you have customized your .ideavimrc file to improve your workflows within your Jetbrains IDE. I'm unsure of its capabilities and would love to know what can be customized. A list of possible customizations would also be helpful. Thanks! 回答1: Basically you can safely source your ~/.vimrc, but be aware that some tricky :map commands may break IntelliJ shortcuts (that was the reason why IdeaVim switched to its own configuration file instead of ~/.vimrc). The

dos2unix doesn't convert ^M

℡╲_俬逩灬. 提交于 2019-12-20 18:09:19
问题 I exported results in a text file from a program running on Windows 7, and copied the file on Xubuntu 14.04. In a terminal, I ran dos2unix file.txt , which tells me converting file out_mapqtl.txt to Unix format . However, when I look at the file with less , I still see the Windows end-of-line as ^M, and wc -l returns me "0". I tried several things described here, but none works. I then opened the file in Vim and did :%s/\r/\r/g as explained there, which worked fine. So any idea why dos2unix

Why use Esc in vim? [closed]

微笑、不失礼 提交于 2019-12-20 18:02:03
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . The Vi editor was originally written on an ADM-3A terminal, which had the Escape key in place of the Tab key (compared to most modern keyboards). Many touch typists appreciate the fact that they can leave their hands on the keyboard home row while using Vim but the use of Esc

Why use Esc in vim? [closed]

≡放荡痞女 提交于 2019-12-20 18:01:14
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . The Vi editor was originally written on an ADM-3A terminal, which had the Escape key in place of the Tab key (compared to most modern keyboards). Many touch typists appreciate the fact that they can leave their hands on the keyboard home row while using Vim but the use of Esc

GreenPlum5安装记录

我与影子孤独终老i 提交于 2019-12-20 17:55:28
GreenPlum5安装记录 安装前准备 挂载磁盘 # fdisk -l # 查看磁盘信息 # df -h # 查看磁盘使用 # 创建本地文件夹 mkdir /data1 # 格式化磁盘 mkfs -t ext4 /dev/vdb # 挂载 mount /dev/vdb /data1 # 开机自动挂载 # vim /etc/fstab /dev/vdb /data1 ext4 defaults 0 0 # 执行 mount -a ​ 关闭SELINUX cat /etc/selinux/config SELINUX=disabled 依次执行: systemctl stop firewalld.service , systemctl disable firewalld.service 。 查看防火墙状态`systemctl status firewalld.service 配置hosts 集群中建议如下命名,方便统一管理: mdw: Master smdw: Master Standby sdw0: Segment 1 …… sdwn: Segment n 172.26.78.203 mdw sdw3 172.26.78.204 sdw1 172.26.78.205 sdw2 smdw 操作系统参数设置 vim /etc/sysctl.conf kernel.shmmax =

Vim different textwidth for multiline C comments?

吃可爱长大的小学妹 提交于 2019-12-20 17:29:25
问题 In our C++ code base we keep 99 column lines but 79-some-odd column multiline comments. Is there a good strategy to do this automagically? I assume the modes are already known because of smart comment line-joining and leading * insertion. 回答1: Apparently both code and comments use the same textwidth option. As far as I can see, the only trick is to set this option dynamically: :autocmd CursorMoved,CursorMovedI * :if match(getline(.), '^\s*\*') == 0 | :setlocal textwidth=79 | :else | :setlocal

Vim different textwidth for multiline C comments?

梦想与她 提交于 2019-12-20 17:29:02
问题 In our C++ code base we keep 99 column lines but 79-some-odd column multiline comments. Is there a good strategy to do this automagically? I assume the modes are already known because of smart comment line-joining and leading * insertion. 回答1: Apparently both code and comments use the same textwidth option. As far as I can see, the only trick is to set this option dynamically: :autocmd CursorMoved,CursorMovedI * :if match(getline(.), '^\s*\*') == 0 | :setlocal textwidth=79 | :else | :setlocal

Executing 'base64 --decode' on a selection in vim

牧云@^-^@ 提交于 2019-12-20 17:05:44
问题 I'm trying to execute 'base64 --decode' on a piece of text selected in visual mode, but the base64 command seems to be passed the entire line, not just the selection I made. I'm selecting the text in visual mode, then entering normal mode so that my command line looks like this: :'<,'>!base64 --decode How should I pass only the selected piece of the line to base64 --decode? Thanks in advance 回答1: If the text to pass to the shell command is yanked to a register (for example, to the unnamed

Mapping one key to multiple commands in vim

流过昼夜 提交于 2019-12-20 16:34:10
问题 I understand that in order to execute multiple command in one line, for example save and execute pdflatex , I can do the following. :w | !pdflatex %:t Note that the %:t gives you the current file name (without path). This code works fine in Vim. Now, if I want to map the whole thing above to, say ctrl+shift+F6, I'd like to be able to do the following :nnoremap <C-S-F6> :w | !pdflatex %:t<CR> But this doesn't work, and gives me the following error. :!pdflatex paper.tex<CR> /bin/bash: -c: line