一

{"type":"编程笔记"}


  • Home

  • Archives
  • Search

vim escape key configuration

Posted on 2020-05-03   |   In linux

个人在 vim 中一直是使用Alt + L代替Escape键,这里没有对这个组合键remap,vim 里原来就支持的,并且响应速度极快,关于这个可以使用:help i_Alt查看说明:

char        action  ~-----------------------------------------------------------------------                                                    *i_CTRL-[* *i_<Esc>*<Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode.  Finish                abbreviation.                Note: If your <Esc> key is hard to hit, try CTRL-[ instead.                                                    *i_META* *i_Alt*                Alt (META) acts like <Esc> if the chord is not mapped.                For example <A-x> acts like <Esc>x if <A-x> does not have an                insert-mode mapping.
Read more »

macos 神器之 hammerspoon 篇

Posted on 2020-05-03   |   In macos

About Hammerspoon

Hammerspoon 是 Mac OS 上强大自动化管理工具,Hammerspoon 的核心只是操作系统和 Lua 脚本引擎之间的桥梁。Hammerspoon 强大之处在于提供了一组扩展,这些扩展向用户提供了特定的系统功能,有了这些扩展,我们可以编写 Lua 脚本来控制 Mac OS X 系统的许多行为。

安装

 brew cask install hammerspoon

第一次打开需要授予系统辅助功能权限 Enable Accessibility,如下 2 图。

配置文件和 Spoon 插件结构

配置文件为 ~/.hammerspoon/init.lua,插件安装目录 ~/.hammerspoon/Spoons。

Read more »

terminal colors tools and tutorial

Posted on 2020-03-18   |   In linux

在 terminal 和 vim 配色时,常会用到颜色名字或者对应的数字,一种方式就是查看网页,如 256 COLORS - CHEAT SHEET,另一种方便的方式,直接在命令行中输出颜色面板和名字,方便配色时引用。

检查当前 Terminal 是否支持 24bit 色彩

可以使用以下脚本,在命令行中运行一下,看输出的结果,可以判断当前 terminal 对 truecolors (24bit)支持的情况。

awk 'BEGIN{    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;    for (colnum = 0; colnum<77; colnum++) {        r = 255-(colnum*255/76);        g = (colnum*510/76);        b = (colnum*255/76);        if (g>255) g = 510-g;        printf "\033[48;2;%d;%d;%dm", r,g,b;        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;        printf "%s\033[0m", substr(s,colnum+1,1);    }    printf "\n";}'

如下是在iTerm.app中的运行结果:

如下图是在Terminal.app中的运行结果,目前应该是只支持 256 色,相比而言,iTerm.app的色彩支持更好:

Read more »

vim killer plugin - 2html.vim

Posted on 2020-03-14   |   In linux

2html.vim 这个内置插件的文档说明:

Vim provides a script that can create an html document (including the foreground and background colors, and syntax highlighting) from the current file, or from selected lines. :help convert-to-HTML

2html.vim 帮助文档里的示例

Here is an example how to run the script over all .c and .h files from a Unix shell:

 for f in *.[ch]; do gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f; done
Read more »

disable macos shortcut command-h

Posted on 2020-03-11   |   In macos

MacOS 使用时经常会误按到Command-H快捷键,或者就是这个快捷键希望绑定在另一个菜单功能上,在网上查了一下,只能按应用单独配置,并且根据应用中下拉菜单的文字进行匹配设置快捷键,菜单文字匹配时区分大小写。

功能修改位置:System Preferences -> Keyboard -> Shortcuts -> App Shortcuts -> +.

如下示例,我把 iTerm2 水平分隔的快捷键改成 command+H,避免与原来的隐藏功能冲突,也可以修改原来默认的 Command+H 的快捷键,如修改了 VMware Fusion 默认的隐藏快捷键:

Read more »
12…99
yuweijun

yuweijun

492 posts
12 categories
RSS
GitHub Twitter
© 2021 yuweijun
Powered by Hexo
Theme - NexT.Mist.KISS