(转帖)Efficient Editing With vim

Vision Mamba 论文学习精读笔记 Efficient Visual Representation Learning with Bidirectional State Space Model 总结了论文中提出的Vision Mamba(Vim)模型的动机、设计以及其在视觉任务上的表现。首先,指出了状态空间模型(SSM)在长序列建模方面的潜力,尤其是Mamba模型在硬件效率方面的优势。纯粹基于 SSM 构建高效且通用的视觉 backbone 是一个有吸引力的方向。然后提到,尽管在视觉数据表示上存在挑战,例如视觉数据的位置敏感性和视觉理解对全局上下文的需求,但作者成功地展示了不必完全依赖自注意力机制来学习视觉表示。文章介绍了Vim模型,这是一种新的通用视觉基础模型,它利用双向Mamba块( 阅读详情

This article has been translated into French by Geoffrey Bachelet. You can read the French version here: L'閐ition efficace avec vim.
"To me, vi is Zen.
To use vi is to practice zen.
Every command is a koan.
Profound to the user,
unintelligible to the uninitiated.
You discover truth every time you use it."
--reddy@lion.austin.com

This tutorial assumes a basic knowledge of vim -- insert mode, command mode, loading and saving files, etc. It is intended to help vi novices develop their skills so that they can use vi efficiently.

In this tutorial, means Ctrl-X -- that is, hold down the Ctrl key and press X. You can get help on most of the commands used here by typing :help command in vim, where command is what you need help on.

Moving efficiently
Stay out of insert mode

In general, you want to spend as little of your time in vim's insert mode as possible, because in that mode it acts like a dumb editor. This is why most vim novices spend so much time in insert mode -- it makes vim easy to use. But vim's real power lies in command mode! You'll find that the better you know vim, the less time you will spend in insert mode.

Use h, j, k, and l

The first step to efficient editing in vim is to wean yourself from the arrow keys. One of the the advantages of vim's modal design is that you do not need to constantly move your hands back and forth between the arrow keys and the letter keys; when you are in command mode, the letters h, j, k and l correspond to the directions left, down, up, and right, respectively. It takes some practice to get used to, but you will notice the speed difference once you're used to it.

When you are editing e-mail or other paragraph-formatted text, you might notice that the direction keys skip more lines than you expect. This is because your paragraphs appear as one long line to vim. Type g before h, j, k or l to move by screen lines instead of virtual lines.

Use motions to move the cursor in the current line

Most editors have only simple commands for moving the cursor (left, up, right, down, to beginning/end of line, etc). vim has very advanced commands for moving the cursor; these commands are referred to as motions. When the cursor moves from one point in the text to another, the text between the points (and including the points themselves) is considered to be "moved over." (This will be important later.)

Here are a few of the more useful motions:

fx
Move the cursor forward to the next occurance of the character x on the current line (obviously, x can be any character you like). This is an extremely useful command. You can type ; to repeat the last f command you gave.

tx
Same as above, but moves the cursor to right before the character, not all the way to it. (It's very useful, really.)

Fx
Move the cursor backward to the next occurance of the character x on the current line.

w
Move the cursor forward by a word.

b
Move the cursor backward by a word.

0
Move the cursor to the beginning of the current line.

^
Move the cursor to the first character on the current line.

$
Move the cursor to the end of the line

)
Move the cursor forward to the next sentence. (Useful when editing e-mail or text documents.)

(
Move the cursor backward by a sentence.

Move efficiently through the file

vim has many commands that can send you to where you want to go in your file -- there's rarely a need to scroll manually through it. The below keystrokes are not technically motions, since they move around in the file instead of in a particular line.


Move the cursor forward by a screenful of text


Move the cursor backward by a screenful of text

G
Move the cursor to the end of the file

numG
Move the cursor line num. (For instance, 10G moves to line 10.)

gg
Move the cursor to the beginning of the file

H
Move the cursor to the top of the screen.

M
Move the cursor to the middle of the screen.

L
Move the cursor to the bottom of the screen.

*
Read the string under the cursor and go to the next place it appears. (For instance, if your cursor was somewhere on the word "bob," the cursor would move to the next occurance of "bob" in your file.)

#
Same as above, except it moves the cursor to the previous occurance.

/text
Starting from the cursor, find the next occurance of the string text and go to it. You will need to press Enter to execute the search. To re-execute your last search, type n (for next occurance).

?text
Same as /, but searches in the opposite direction.

ma
Make a bookmark named a at the current cursor position. A bookmark can be named any lowercase letter. You can't see the bookmark, but it's there!

`a
Go to bookmark a. Important: that's a backtick, not a single quote. The backtick is located to the left of the 1 on most keyboards.

`.
Go to the line that you last edited. This is very useful! If you need to scroll through the file to look something up, you can go back to where you were without bookmarking it by using the `. command.

Typing efficiently
Use keyword completion

vim has a very nice keyword completion system. This means that you can type part of a long word, press a key, and have vim finish the word for you. For instance, if you have a variable called iAmALongAndAwkwardVarName somewhere in your code, you probably don't want to type the whole thing in every time you use it.

To use keyword completion, just type the first few letters of the string (e.g. iAmAL) and press (that means hold down Ctrl and type N) or . If vim doesn't give you the word you want at first, keep trying -- vim will cycle through all completions it can find.

Enter insert mode intelligently

Most users new to vim get into insert mode by typing i. This works, but it's often pretty inefficient, since vi has a host of commands that leave the editor in insert mode. Here are some of the more popular ones:

i
Insert text to the left of the current character.

I
Insert text at the beginning of the current line.

a
Insert text to the right of the current character.

A
Insert text at the end of the current line.

o
Create a new line under the current one and insert text there.

O
Create a new line above the current one and insert text there.

c{motion}
Delete (change) the text moved over by {motion} and insert text to replace it. For instance, c$ would delete the text from the cursor to the end of the line and enter insert mode. ct! would delete the text from the cursor up to (but not including) the next exclamation mark and enter insert mode. The deleted text is copied to the clipboard and can be pasted.

d{motion}
Delete the text moved over by {motion} -- same as c{motion}, but doesn't enter insert mode.

Moving blocks of text efficiently
Use visual selections and the appropriate selection mode

Unlike the original vi, vim allows you to highlight text and perform operations on it. There are three main visual selection modes (that is, text highlighting modes). These modes are as follows:

v
Characterwise selection mode. This is the selection mode that most people are used to, so practice with it before trying the others.

V
Linewise selection mode. Whole lines are always selected. This is better than characterwise mode when you want to copy or move a group of lines.


Blockwise selection mode. Extremely powerful and available in very few other editors. You can select a rectangular block and any text inside that block will be highlighted.

All the usual cusor movement keys apply -- so, for instance, vwww would go into visual selection mode and highlight the next three words. Vjj would go into linewise visual selection mode and highlight the current line and the two lines below it.

Cutting and copying from visual selections

Once you have a highlighted selection, you probably want to do something with it. Some of the more useful commands you can give when an area of text is highlighted:

d
Cut (delete) the highlighted text and put it into the clipboard.

y
Copy (or yank, which is vim-ese for "copy") the highlighted text into the clipboard.

c
Cut the highlighted text into the clipboard. This is just like d, except it leaves the editor in insert mode.

Cutting and copying from non-visual selections

If you know exactly what you want to copy or cut, you can do it without entering visual mode. This saves time.

d{motion}
Cut the text moved over by {motion} to the clipboard. For instance, dw would cut a word and dfS would cut from the cursor up to and including the next capital S on the current line of text.

y{motion}
Copy the text moved over by {motion}.

c{motion}
Cut the text moved over by {motion} and leave the editor in insert mode.

dd
Cut the current line.

yy
Copy the current line.

cc
Cut the current line and leave the editor in insert mode.

D
Cut from the cursor to the end of the current line.

Y
Yank the whole line, just like yy. (Yes, it's inconsistent! You can use y$ to do what you would expect Y to do.)

C
Cut from the cursor to the end of the current line and leave the editor in insert mode.

x
Cut the current character. (This is sort of like a command-mode backspace.)

s
Cut the current character and leave the editor in insert mode.

Pasting

Pasting is easy. Put the cursor where you want the pasted text and type p.

Using multiple clipboards

Most editors have a single clipboard. vim has many more; clipboards in vim are called registers. You can list all the currently defined registers and their contents by typing :reg. Typically, you'll be using the lowercase letter registers; the others are used for various internal vim purposes and are only occasionally helpful.

To use a specific register for a copy or paste operation, simply type "a before the command for the operation, where a is the register you want to use.

For example, to copy the current line into register k, you could type "kyy. (You could also type V"ky. Why would that work?). That line would stay in register k until you specifically copied something else into register k. You would then use "kp to paste the text from register k.

Avoiding repetition
The amazing . command

In vi, typing . (a period) will repeat the last command you gave. For instance, if your last command was dw (delete word), vi will delete another word.

Using counts

Counts are one of the most powerful and time-saving features of vim. Any command can be preceded by a number. The number will tell vim how many times to execute the command. Here are a few examples:

3j will move the cursor down three lines.

10dd will delete ten lines.

y3"e; will yank (copy) text from the cursor to the third quotation mark after the cursor on the current line. Counts are useful to extend the range of a motion in this manner.

Recording macros

Occasionally, you'll find yourself doing the same thing over and over to blocks of text in your document. vim will let you record an ad-hoc macro to perform the operation.

qregister
Start macro recording into the named register. For instance, qa starts recording and puts the macro into register a.

q
End recording.

@register
Replay the macro stored in the named register. For instance, @a replays the macro in register a.

Keep in mind that macros just record your keystrokes and play them back; they are not magic. Recording macros is almost an art form because there are so many commands that accomplish a given task in vim, and you must carefully select the commands you use while your macro is recording so that they will work in all the places you plan to execute the macro.

Writing code in vim

vim is an excellent editor for source code because it has many features that are specifically designed to help programmers. Here are a few of the more handy ones:

]p
Just like p, but it automatically adjusts the indent level of the pasted code to match that of the code you paste into. Try it!

%
Putting the cursor on a brace, bracket, or parenthese and pressing % will send the cursor to the matching brace, bracket, or parenthese. Great for fixing parse problems related to heavily nested blocks of code or logic.

>>
Indent the highlighted code. (See the earlier section about efficient text selection. If no text is selected, the current line is indented.)

<<
Like >>, but un-indents.

gd
Go to the definition (or declaration) of the function or variable under the cursor.

K
Go to the man page for the word currently under the cursor. (For instance, if your cursor is currently over the word sleep, you will see the man page for sleep displayed.)

cursor,程序员的福音,Cursor可以帮助开发者快速生成代码,提高开发效率 Cursor.so是一款基于GPT的代码生成工具,它可以帮助开发者快速生成代码,提高开发效率。GPT是一种自然语言处理技术,可以根据输入的文本生成相应的文本。Cursor.so利用GPT技术,将开发者的自然语言描述转化为代码,从而实现代码的快速生成。 Cursor.so和GPT的合作关系可以分为两个方面:一是Cursor.so利用GPT技术生成代码,二是Cursor.so通过GPT技术进行代码补全和代码纠错。 在代码生成方面,Cursor.so利用GPT技术生成代码,可以帮助开发者快速生成代码。开发者只需要输入自然语言描述,就可以得到相应的代码。例如,开发者可以输入“生成一个React组件”,Cursor.so就会根据这个描述生成相应的React组件代码。这种方式可以大大提高开发效率,减少开发时间。 在代码补全和代码纠错方面,Cursor.so也利用了GPT技术。当开发者输入代码时,Cursor.so会根据GPT技术进行代码补全和代码纠错。例如,当开发者输入“console.lo”,Cursor.so会自动补全为“console.log”,从而避免了开发者手动输入的错误。 立即下载

相关推荐

电源完整性之Cadence Sigrity Power DC_IR_Drop仿真

之前和大家分享过电源完整性之仿真设计原理链接: link.今天接着上一篇文章总结一下电源直流压降的的仿真操作流程及一些simulation中的设置参数,用到的时候Cadence Sigrity 中的Power DC组件,下面开始享受仿真的快乐吧: 1.仿真模式选择与文件导入 选择Cadence Sigrity下的Power DC组件,然后先择licence,最后就可以打开我们之前转化好的.SPD文件。操作如下图: 2.设置层叠信息和过孔焊盘参数 层叠信息:每层的介质厚度、材料、介电常数、介质损耗角等,如

刘小同学的博客 1万+

从零开始学习Cursor.so的方法和技巧

Cursor.so是一个软件开发工具,它可以让你用一个强大的AI来编写、编辑和聊天关于你的代码。它支持多种编程语言,如Python、Java、C#等,并且可以帮助你重构、理解和优化你的代码。Cursor.so还有一个聊天功能,你可以跟AI交流,询问问题,获取建议,甚至让AI写一些有趣的东西。

sinat_35073873的博客 7358

libcrypto.so.10(OPENSSL_1.0.2)(64bit) is needed by erlang-22.0.7-1.el7.x86_64

今天安装Rabbitmq的 erlang-22.0.7-1.el7.x86_64.rpmrpm包时遇到了这个坑,害找到说是不容易;错误信息在下面; [root@iz2zef7u84js1qeeq00ewwz RabbitMQ]# rpm -ivh erlang-22.0.7-1.el7.x86_64.rpm warning: erlang-22.0.7-1.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY error:

qq_45782349的博客 5784

智能工具Cursor安装和使用

智能AI代码生成工具Cursor安装和使用

Charge8的博客 3万+

Python+Appium实现泛微OA自动打卡:5分钟搭建移动端自动化脚本

移动端自动化测试是软件测试与办公自动化领域的重要技术方向,其核心原理是通过程序模拟用户对手机应用界面的操作,实现重复性任务的自动执行。Appium作为主流的开源移动端自动化框架,基于WebDriver协议,支持跨平台且无需修改被测应用,为自动化脚本开发提供了标准化接口。在工程实践中,结合Python简洁的语法和丰富的生态,可以快速构建稳定可靠的自动化解决方案。这一技术组合的价值在于能够高效处理“重复性、低价值、高频率”的日常操作,例如考勤打卡、数据填报等办公场景,显著提升工作效率。本文以泛微OA Emobi

weixin_28836875的博客 391

电池充电管理芯片规格书精读指南:从参数解析到设计实战

电池充电管理是嵌入式系统和便携式设备开发中的基础环节,其核心在于理解并应用充电芯片的规格参数。充电芯片通过精确控制电压、电流、温度等关键参数,实现对锂电池等可充电电池的安全、高效管理。掌握这些参数原理,对于优化产品功耗、提升充电效率、保障电池寿命具有重要技术价值,广泛应用于智能穿戴、消费电子、无人机等场景。本文聚焦于**充电电流**设定与**热管理**等核心参数,深入解析其相互影响与工程选型中的权衡,旨在帮助开发者将抽象的规格书数据转化为可靠的电路设计依据,从而有效排查充电故障,提升产品整体可靠性。

weixin_26874745的博客 669

【最详细教程Cursor】智能 AI 代码生成工具 Cursor 安装和使用介绍

Cursor.so 是一个集成了 GPT-4 的国内直接可以访问的,优秀而强大的免费代码生成器,可以帮助你快速编写、编辑和讨论代码。它支持多种编程语言,如 Python, Java, C#, JavaScript 等,并且可以根据你的输入和需求自动生成代码片段。Cursor.so 还可以帮助你重构、理解和优化代码,提高开发效率。强烈建议程序员们都要安装使用,将带来革命性的编码效率提升。本文简单介绍下 Cursor 的安装和使用。本文只是一个使用 Cursor 的简单示例,帮助大家如何安装和使用。

wufaqidong1的博客 10万+

TPS563201DDCR电路翻车实录:从原理图到PCB,我踩过的5个坑及补救方法

本文详细记录了使用TPS563201DDCR电源芯片设计电路时遇到的5个常见问题及解决方案,包括EN引脚配置、BST电容选型、反馈网络设计、PCB布局优化以及散热处理。通过实际案例和数据分析,帮助工程师避免类似错误,提升电源模块的可靠性和效率。

weixin_42532938的博客 533

Cursor编辑器安装教程

cursor编辑器的简单使用

蓝朽的小世界 3273

【Unity实战】实现最完美最简单的UI适配方案,背景压缩或者拉伸变形解决方案,手机刘海屏适配,适配不同分辨率,不同尺寸,不同设备。

这期来讲一个简单的UI设计方案,很多同学可能搞不懂锚点、轴心这些概念,导致做好的UI在别人的设备上,乱跑或者是重叠,或者是参加游戏老发时间比较紧来不及做适配,都可以来试试这个方法,通过填充边框来保持游戏画面的原始比例,所以它的缺点也很明显,在一些移动设备上会浪费比较大的显示面积。 unity不同设备UI变形? UI在不同设备上如何适配?

向宇的博客,专注php/web全栈 unity游戏开发,欢迎大家评论纠错 3655

[VCS]VCS dump fsdb的精细化控制

本文介绍了VCS FSDB波形dump的精细化控制方法。主要内容包括:1)基本dump方式;2)通过$fsdbDumpoff排除特定层次;3)使用$fsdbDumpvars选择性dump指定模块;4)运行时动态控制dump开关;5)通过文件管理排除列表($fsdbDumpoffFile或自定义读取);6)层次控制策略(剪除整棵树或仅当前层)。这些方法可有效控制波形文件大小,提高仿真效率。

元直的博客 1035

Cursor:一个集成GPT-4的IDE开发工具

cursor.so 是一个适合程序员编码的,且集成了 GPT-4 的免费 IDE 工具(目前免费),可以帮助用户快速编写、编辑和优化代码。cursor.so 支持主流的编程语言,并且可以根据用户的输入描述自动生成满足需求的代码片段。cursor.so 还可以帮助用户优化和重构代码,或者为陌生的代码添加注释以帮助理解代码,提高开发效率。总而言之,这是一款革命性的编码 IDE 工具,目前官网提供了 Windows、Linux 和 macOS 三个版本的发行版。

chszs的专栏 6999

基于STM32L4XX 、HAL库的TMC2209-LA-T步进电机驱动器驱动程序应用设计

/ R/W=0 表示写。uint32_t gconf_value = (0 << 0) // I_scale_analog: 禁用,使用UART控制电流。uint32_t ihold_irun = (8 << 0) // 保持电流 8/31 最大值。

PP_Cottage的博客 450

高效使用vim (Efficient Editing With vim)

原英文教程见 (Original tutorial in English) http://jmcpherson.org/editing.html About copyright: I sent e-mail to Jonathan McPherson (author of this tut...

chuanluo4888的博客 234

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Efficient Editing With vim

This tutorial assumes a basic knowledge of vim -- insert mode, command mode, loading and saving files, etc. It is intended to help vi novices develop their skills so that they can use vi ef...

weixin_34357267的博客 192

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

高效使用vim (Efficient Editing With vim

声明: 我给此教程作者Jonathan McPherson发送电子邮件, 询问是否可以把它翻译成中文并贴在我的web log上, 他同意了我的要求. 关于此教程, 所有的权利属于作者Jonathan, 如果你希望转载或者把此教程用于其它用途, 请与作者Jonathan联系,

Augmented Reality & Computer Graphics 1429

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

高效使用vim(Efficient Editing With Vim)

转载自:PYTHON俱乐部 原文地址:http://www.pythonclub.org/linux/vim/efficient-editing 原英文教程见 (Original tutorial in English) http://jmcpherson.org/editing.html 高效使用vim(Efficient Editing With Vim

zhangxiaoxu1218的专栏 463

CVPR Efficient ViM:视觉 Mamba 的轻量化

对比竞品:相比于最新的轻量级 SOTA 模型 SHVIT-S1,Efficient ViM 在相同精度下,推理速度快了 1.3 倍;它先不急着混合,而是把特征压缩到极小的隐状态里,然后在隐状态空间里做混合。作用:就像给模型装了“记忆体”,让深层网络能回忆起图像的纹理细节,弥补了轻量级模型表征能力弱的短板。单头设计:作者发现“多头”机制在轻量级模型上会增加显存读写负担,所以改成了更高效的“单头”模式。效果:因为隐状态维度远小于序列长度,计算量直接暴跌,实现了“在压缩空间做昂贵运算”。

2501_94316486的博客 646

《Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model》论文精度

近年来,具有高效硬件感知设计的状态空间模型(ssm),即Mamba深度学习模型,在长序列建模方面显示出巨大的潜力。同时,纯粹在ssm上构建高效和通用的视觉骨干是一个吸引人的方向。然而,由于视觉数据的位置敏感性和视觉理解对全局上下文的需求,表示视觉数据对ssm来说是具有挑战性的。本文表明,对视觉表示学习的自注意力的依赖是不必要的,并提出了一种新的双向Mamba块(Vim)的通用视觉骨干,用位置嵌入标记图像序列,用双向状态空间模型压缩视觉表示。

qq_46981910的博客 1953

Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model 论文总结

Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model 论文总结

qq_45981086的博客 2522

(1)Papar Reading——Vision Mamba: Efficient Visual Representation Learning with Bidirectional SSM

最近,具有高效硬件感知设计的状态空间模型(SSMs),即Mamba,在长序列建模方面显示出巨大潜力。纯粹基于SSMs构建高效通用的视觉backbone是一个有吸引力的方向。然而,由于视觉数据的位置敏感性和视觉理解对全局上下文的要求,对于ssm来说,视觉表示数据是一个挑战。在本文中,我们证明了视觉表示学习对自注意力的依赖并非必要,并提出了一种新的具有双向Mamba块(Vim)的通用视觉骨干,它使用位置嵌入标记图像序列,并利用双向状态空间模型压缩视觉表示。

智能养猪的博客 2526

【论文阅读】Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model

状态空间模型(SSMs)在长序列建模方面展现出了巨大潜力,如Mamba。然而,将SSMs应用于视觉数据表示存在挑战,因为视觉数据对位置敏感,且需要全局上下文以理解视觉信息。

Prettybritany的博客 1069

论文阅读:Vision Mamba- Efficient Visual Representation Learning with Bidirectional State Space Model

提出了一种带有双向Mamba块(Vim)的新通用视觉baseline

weixin_49641282的博客 4189
上一篇: C/C++学习笔记
下一篇: RMI@Spring的常见问题解决
Model_CZ
博客等级 码龄19年 223粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值