跳至主要内容

Vim命令学习

一般模式切换至编辑模式

  • i,I    从目前光标所在处插入,从所在行第一个非空格符处插入
  • a,A    从光标所在下一个字符开始插入,从光标所在行最后一个字符出开始插入
  • o,O    下一行插入,上一行插入
  • r,R    替换光标所在字符一次,一直替换直至[Esc]

常用操作

  • dd    删除光标所在行       ndd    删除光标所在的向下20
  • dw    删除一个字(word)
  • J    两行合并
  • u    复原前一个操作         ctrl-r   重做上一个操作
  • .    重复前一个操作,重复删除,重复粘贴都常用到
  • x,X    相当于[Del],[Backspace]
  • D    删除到行末
  • yy    复制光标所在行         nyy,表示从当前行开始复制n
  • yw    复制一个字
  • y$    复制到行末
  • p,P    将复制数据粘贴在下一行,上一行

查找和替换

  • /word    向下查找带有word字符串
  • ?word    向下寻找带有word字符串
  • :n1,n2s/word1/word2/g    在第n1行和第n2行之间替换word1word2
    • :n1,$s/word1/word2/gc   从第一行搜寻至最后一行,替换之前询问用户

退出VIM

  • :w[filename]  将缓冲区写入文件,即保存文件
  • :q     退出,如果对缓冲区进行过修改,则会提示
  • :q!     强制退出,放弃修改
  • :wq     保存修改并退出
  • :x     保存修改并退出

窗口命令

  • ctrl+w s     水平分割窗口
  • ctrl+w w     切换窗口
  • ctrl+w q     退出当前窗口(由于同时有多个文件,此命令不会影响其他窗口)
  • ctrl+w v     垂直分割窗口

页面操作

  • h,j,k,l     上,下,左,右
  • ctrl-f     相当于pagedown
    c
    trl-b     相当于pageup
  • $     ^        跳至行尾           跳至行首的第一个字符
  • home0  end$     移动到这一行行首/行尾
  • gg    G   跳至文件的第一行      最末行
  • nG         移动到这个文件的第n         gg 本质上相当于1G
  • N[ENTER]  n为数字,光标向下移动n行

Popular posts from 产品随想的博客

A Sister’s Eulogy for Steve Jobs

I grew up as an only child, with a single mother. Because we were poor and because I knew my father had emigrated from Syria, I imagined he looked like Omar Sharif. I hoped he would be rich and kind and would come into our lives (and our not yet furnished apartment) and help us. Later, after I’d met my father, I tried to believe he’d changed his number and left no forwarding address because he was an idealistic revolutionary, plotting a new world for the Arab people. Even as a feminist, my whole life I’d been waiting for a man to love, who could love me. For decades, I’d thought that man would be my father. When I was 25, I met that man and he was my brother. By then, I lived in New York, where I was trying to write my first novel. I had a job at a small magazine in an office the size of a closet, with three other aspiring writers. When one day a lawyer called me — me, the middle-class girl from California who hassled the boss to buy us health insurance — and said his cl...

产品随想 | 周刊 第130期:集结信徒,而非官僚

On Dyson, techno-centric design and social consumption   https://2earth.github.io/website/20250707.html 如何創造偉大的事物   https://ryolu.notion.site/1610a94b9c108079a95be4362afd4a26 集結信徒,而非官僚 Reflections on OpenAI   https://calv.info/openai-reflections 创业架构 Shui   https://github.com/rock-zhang/Shui 好好喝水 https://www.ghibli.jp/works/ 吉卜力作品的高清图 From Skeuomorphic to Liquid Glass: Apple's Strategic Bet on the Post-Touch Future   https://omc345.substack.com/p/from-skeuomorphic-to-liquid-glass 迄今为止关于苹果Liquid Glass变革的解读,最好的一篇 The Nueva School   https://en.wikipedia.org/wiki/The_Nueva_School?useskin=vector 看起来是很酷的一个学校 The Barbican   https://arslan.io/2025/05/12/barbican-estate/ 史蒂夫·乔布斯希望你阅读的 9 本书   https://www.douban.com/doulist/147158849/ 《禅者的初心》里有句话:“做任何事,其实都是在展示内心的天性,这是我们存在的唯一理由。” Chuck Feeney was one of the greatest philanthropists ever   https://www.gatesnotes.com/Remembering-Chuck-Feeney 慈善家 My new deadline: 20 years to give away virtually all my wealt...

《Becoming Steve Jobs》Chapter 16 Blind Spots, Grudges, and Sharp Elbows

Steve could be pretty thin-skinned when someone prominent criticized the aesthetics of his products. He took great umbrage that Neil would, as Steve put it, “pop off in public like that without coming to talk to us about his technical concerns first.” From that point on he had rebuffed all of Neil’s attempts to smoke the peace pipe. 有趣 He had blind spots, grating behavioral habits, and a tendency to give in to emotional impulse that persisted his entire life. These characteristics are often used to make the case that Steve was an “asshole” or a “jerk,” or perhaps simply “binary”—that odd adjective often used to convey the sense that he was half asshole/half genius from birth to death. These aren’t useful, interesting, or enlightening descriptions. What’s more illuminating is to take a look at the specific ways in which Steve failed to do an effective job of tempering some of his weaknesses and antisocial traits, and to consider how, when, and why some of them continued to flare up even...

2018各行业应届生薪资不完全样本往期汇总-职场红领巾

文章来源自职场红领巾公众号2018.4.21日推送,在此表示感谢 产品岗 百度商业产品 14K*14 拼多多产品管培 12K*14 今日头条产品 16K*18 头条PM整个Package接近300K/年 美团产品Offer 14K*16 base上海 百度产品研究生 11.5K*14.6 base 上海 京东产品17K*13 百度产品 220K/年 网易 产品培训生 硕士 15K*18 SP base杭州 不知名互联网公司校招PM 12K*15 base北京 技术岗 微软 软件工程师 本科 260K/年 蚂蚁金服算法工程师 20K*16 拼多多开发本科400K/年 商汤科技本科技术岗 14K/月 税前 海康威视研究院 算法工程师 220K/年 微信算法岗 SP 360K/年 的package 今日头条 程序员 研究生 10K/月 base北京 滴滴程序员 16K*16 亚马逊 小四年经验 研发 50K/月 Facebook应届毕业生  软件开发工程师   打包 115k$/年(30%-40%税) base湾区 京东算法 普通Offer 234K/年 运营岗 滴滴北京运营岗 硕士 12K*15 奖金另算 网易游戏运营 150K/年 左右 网易运营 8K*13(奖金0~3个月) 网易新闻运营8K/月 腾讯游戏运营 本科6K/月 上海京东时尚本科8K/月 京东运营岗 11K/月 base北京亦庄总部 今日头条 渠道营销运营 6K/月(加房补) 网易考拉 活动运营 13K*16 OFO城市运营管培13K*14 爱范儿运营 8K/月 滴滴长三角某二线城市运营管培生 薪资 7.6K*13 +每个月40%绩效 货车帮 数据运营 12K/月 卡宾电商 管培 10K/月 含浮动绩效 曹操专车 运营管培生  加各种补贴税前5.4K/月  base杭州 京东金融海龟回来8K/月 北京蓝港互动...

Steve Jobs at 44, By Michael Krantz, 1999

Differences and Similarities Between Apple and Pixar Apple turns out many products--a dozen a year; if you count all the minor ones, probably a hundred. Pixar is striving to turn out one a year. But the converse of that is that Pixar's products will still be used fifty years from now, whereas I don't think you'll be using any product Apple brings to market this year fifty years from now. Pixar is making art for the ages. Kids will be watching Toy Story in the future. And Apple is much more of a constant race to continually improve things and stay ahead of the competition.  His Role At Pixar At Pixar my job is to help build the studio and recruit people and help create a situation where they can do the best work of their lives. And to some degree it's the same at Apple. But at Pixar, I don't direct the movies, whereas at Apple probably, if I had to pick a role out of a film production, I'd be the director. So it...

Foobar2000 组件安装教程

 原作者 博客地址   汉化作者 Asion博客   关于foobar 2000的一些资源 前言 foobar2000 由于其软件架构特点以及开放的姿态,使得第三方很容易开发组件(component)来拓展它的功能。由于在官网下载的默认安装文件只带了少量几个默认的组件,满足不了使用的需求,例如:默认不带 ape,tta,tak 等音频文件格式的解码器,很多无损压缩格式音乐没法播放。所以自己下载安装组件是必备的基本技能。 foobar2000 的中文汉化版(Asion 汉化)为了方便使用,集成了无损压缩文件解码器以及一些其它有用的插件,安装时选上即可,不喜欢折腾的建议使用汉化版。 这里组件指的是 foobar2000 标准组件(*.dll 文件),而非 vst 插件等其它插件,姑且把组件分为两类: 官方组件: 英文版安装包自带,安装时可选择; 第三方组件:非官方自带的组件 除了 foo_input_std.dll 和 foo_ui_std.dll 这两个组件是必须的外,其它的所有组件都 非必需 的,可以随需要增删。第三方组件可以去 官网 、 官方论坛 或者 官方 wiki 去找,也可以去贴吧等地逛逛。 下载 还是要强调一下,这里说的是 foobar2000 component ,不是中文网上通常说的 vst 插件。 下载好的组件包一般是 xxx.zip 或 xxx.fb2k-component 格式的文件,也有用 7z 打包的。前两种都是 zip 压缩(只要把 fb2k-component 改成 zip 文件就变成了 zip: 包)。标准状况下压缩包里的内容结构应该是 xxx.zip yyy.dll README.txt (可能没有) LICENCE.txt (可能没有) (其它杂七杂八) 除少数外一般只有一个 xxx.dll 文件.一定要注意压缩包结构不能是: xxx.zip yy folder (文件夹) zzz.dll … 否则要解压缩,提取那个 dll 文件。 安装 方法一(推荐) 打开 foobar2000 的菜单 文件 > 首选项(file >preferences) 的 组件(components...

黑客技术论坛推荐

原文来自知乎, 世界各大黑客技术论坛TOP排行榜 ,表示感谢 这份名单基本上囊括了目前世界上各大最佳黑客技术论坛。

产品随想 | 周刊 第106期:Architecture cannot save the world, but it may serve as a good example

“He who lives to see two or three generations is like a man who sits some time in the conjurer’s booth at a fair and witnesses the performance twice or thrice in succession. The tricks were meant to be seen only once; and when they are no longer a novelty and cease to deceive, their effect is gone.” — Arthur Schopenhauer 近 30 年戴镜史,分享我的配镜方法和粗浅经验   https://sspai.com/post/79573 Leslie Berlin   https://leslieberlinauthor.com/ 硅谷历史学家,对硅谷发展做出表述 曾撰写诺伊斯的传记,也是乔布斯Make Something Wonderful的编辑之一 Pre to postmortem: the inside story of the death of Palm and webOS   https://www.theverge.com/2012/6/5/3062611/palm-webos-hp-inside-story-pre-postmortem Palm的荣光 Loren Pope, former education editor for The New York Times, writes about Reed in Colleges That Change Lives, saying, "If you're a genuine intellectual, love the life of the mind, and want to learn for the sake of learning, the place most likely to empower you is not Harvard, Yale, Princeton, Chicago, or Stanford. It is the most intelle...

产品随想 | 周刊 第40期:献出心脏,直到高墙倒塌

标题来自本期的一个链接,觉得充满理想主义,献给大家! Products Movie Robot   https://github.com/pofey/movie_robot 定时自动从豆瓣电影的想看、在看、看过中获取影音信息,然后去PT站(支持多家站点)自动检索种子,找到最佳资源后按豆瓣电影分类提交到BT下载工具下载。在下载前,会自动检查你的Emby中是否已经存在。 工具超赞,一次搭建,可以很长一段时间躺平,但针对我这样对4K、HDR有高要求用户,可能不大行 Plash   https://github.com/sindresorhus/Plash Make any website your Mac desktop wallpaper 将任意网站,定义为Mac桌面 https://github.com/sindresorhus/Plash/issues/1,网友给的一些网站,也比较有意思 HomeBank   http://homebank.free.fr/zh/index.php 自由、开源的会计软件 GnuCash   https://www.gnucash.org/ https://github.com/Gnucash/gnucash 自由开源,多平台的财务软件,且有很好看的官方App,since 1998 beancount   https://github.com/beancount/beancount Beancount: Double-Entry Accounting from Text Files. 纯文本的复式记账工具 rimerc: rimer's dictionary & config   https://github.com/Bambooin/rimerc Rime输入法在各个平台的配置 Natural Selection Labs   https://github.com/NaturalSelectionLabs DIYGod主导的聚焦Web3的项目,非常有雄心,保持关注! PineTab   https://www.pine64.org/pinetab/ The Open Source ARM 64-bit Tablet 自由开源的64位平板电脑(在28...

Steve Jobs: `There's Sanity Returning', 1998

Nobody can doubt the charisma of Steven P. Jobs. The interim CEO of Apple Computer Inc., who returned to the company last July after his ignominious 1985 ouster, has brought back his legendary vision, impatience, and infectious passion for the Macintosh. Jobs spoke to Business Week Correspondent Andy Reinhardt in Apple's stark, fourth-floor boardroom, just after the company rolled out its new software strategy on May 11. Note: This is an extended, online-only version of the Q&A that appears in the May 25, 1998, issue of Business Week. Q: Now that you've introduced the new, bold-looking iMac, are you going to do some radically different products? A: There's a lot of talk about such things -- about handhelds, set-top boxes. A lot of computer companies have been searching for a consumer product. My view is that the personal computer has been the most successful consumer product of the last 10 years. What we have to do, what the industry stopp...