除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

Vim、Emacs配置和使用
回复
头像
oldfeel
帖子: 134
注册时间: 2011-08-09 20:46

除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#1

帖子 oldfeel » 2012-10-12 22:29

最近学习html5经常要敲各种标签引号,用gedit编辑没有光标快捷键(上下左右/行首/行尾)感觉甚是难受。用eclipse写html又很卡,所以想换一种编辑器了。请大神们指引有没有什么编辑器可以自定义光标快捷键,像这个一样http://www.oldfeel.cn/?p=479
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#3

帖子 lilydjwg » 2012-10-12 22:59

PS: 这么简单的键绑定 GTK 2 也能做到。
PPS: 新版的 GTK 3 目前还做不到。
头像
oldfeel
帖子: 134
注册时间: 2011-08-09 20:46

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#4

帖子 oldfeel » 2012-10-12 23:06

lilydjwg 写了:vim, emacs.
哥~vim不能在编辑状态下定义光标快捷键,emacs的插件安装太复杂,小菜连个格式化代码都装不好,有木有其他的了?
头像
oldfeel
帖子: 134
注册时间: 2011-08-09 20:46

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#5

帖子 oldfeel » 2012-10-12 23:07

lilydjwg 写了:PS: 这么简单的键绑定 GTK 2 也能做到。
PPS: 新版的 GTK 3 目前还做不到。
具体怎么操作啊??
头像
qute
帖子: 24
注册时间: 2011-05-24 17:05
系统: ubuntu

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#6

帖子 qute » 2012-10-12 23:07

Emacs无误

代码: 全选

 _____________
< Hello World >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#7

帖子 lilydjwg » 2012-10-12 23:13

oldfeel 写了:
lilydjwg 写了:vim, emacs.
哥~vim不能在编辑状态下定义光标快捷键,emacs的插件安装太复杂,小菜连个格式化代码都装不好,有木有其他的了?
谁说不能?

代码: 全选

  noremap! <C-B> <Left>
  noremap! <C-F> <Right>
  noremap! <C-A> <Home>
  inoremap <C-E> <End>
  inoremap <C-P> <Up>
  inoremap <C-N> <Down>
  noremap! <M-b> <S-Left>
  noremap! <M-f> <S-Right>
头像
oldfeel
帖子: 134
注册时间: 2011-08-09 20:46

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#8

帖子 oldfeel » 2012-10-12 23:14

lilydjwg 写了:
oldfeel 写了:
lilydjwg 写了:vim, emacs.
哥~vim不能在编辑状态下定义光标快捷键,emacs的插件安装太复杂,小菜连个格式化代码都装不好,有木有其他的了?
谁说不能?

代码: 全选

  noremap! <C-B> <Left>
  noremap! <C-F> <Right>
  noremap! <C-A> <Home>
  inoremap <C-E> <End>
  inoremap <C-P> <Up>
  inoremap <C-N> <Down>
  noremap! <M-b> <S-Left>
  noremap! <M-f> <S-Right>
:em05 谢谢!!!小看vim了,以后就用这个了。。。
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#9

帖子 lilydjwg » 2012-10-12 23:15

oldfeel 写了:
lilydjwg 写了:PS: 这么简单的键绑定 GTK 2 也能做到。
PPS: 新版的 GTK 3 目前还做不到。
具体怎么操作啊??

代码: 全选

#
# Bindings for GtkTextView and GtkEntry
#
binding "gtk-emacs-text-entry" {
  bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) }
  bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) }
  bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) }
  bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) }

  bind "<alt>b" { "move-cursor" (words, -1, 0) }
  bind "<shift><alt>b" { "move-cursor" (words, -1, 1) }
  bind "<alt>f" { "move-cursor" (words, 1, 0) }
  bind "<shift><alt>f" { "move-cursor" (words, 1, 1) }

  bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) }
  bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) }
  bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) }
  bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) }

  bind "<ctrl>y" { "paste-clipboard" () }

  bind "<ctrl>d" { "delete-from-cursor" (chars, 1) }
  bind "<alt>h" { "delete-from-cursor" (chars, 1) }
  bind "<alt>d" { "delete-from-cursor" (word-ends, 1) }
  bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) }

  bind "<ctrl>u" {
     "delete-from-cursor" (paragraph-ends, -1)
  }
  bind "<ctrl>h" { "delete-from-cursor" (chars, -1) }
  bind "<ctrl>w" { "delete-from-cursor" (word-ends, -1) }
}

#
# Bindings for GtkTextView
#
binding "gtk-emacs-text-view"
{
  bind "<ctrl>p" { "move-cursor" (display-lines, -1, 0) }
  bind "<shift><ctrl>p" { "move-cursor" (display-lines, -1, 1) }
  bind "<ctrl>n" { "move-cursor" (display-lines, 1, 0) }
  bind "<shift><ctrl>n" { "move-cursor" (display-lines, 1, 1) }
}

#
# Bindings for GtkTreeView
#
binding "gtk-emacs-tree-view"
{
  bind "<ctrl>n" { "move-cursor" (logical-positions, 1) }
  bind "<ctrl>p" { "move-cursor" (logical-positions, -1) }
}

#
# Bindings for menus
#
binding "gtk-emacs-menu"
{
  bind "<ctrl>n" { "move-current" (next) }
  bind "<ctrl>p" { "move-current" (prev) }
  bind "<ctrl>f" { "move-current" (child) }
  bind "<ctrl>b" { "move-current" (parent) }
}

class "GtkEntry" binding "gtk-emacs-text-entry"
class "GtkTextView" binding "gtk-emacs-text-entry"
class "GtkTextView" binding "gtk-emacs-text-view"
class "GtkTreeView" binding "gtk-emacs-tree-view"
class "GtkMenuShell" binding "gtk-emacs-menu"
加到 ~/.gtkrc-2.0 中。
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#10

帖子 lilydjwg » 2012-10-12 23:19

oldfeel 写了:
lilydjwg 写了:

代码: 全选

  noremap! <C-B> <Left>
  noremap! <C-F> <Right>
  noremap! <C-A> <Home>
  inoremap <C-E> <End>
  inoremap <C-P> <Up>
  inoremap <C-N> <Down>
  noremap! <M-b> <S-Left>
  noremap! <M-f> <S-Right>
:em05 谢谢!!!小看vim了,以后就用这个了。。。
觉得好用的话不妨试试整个配置:
https://github.com/lilydjwg/dotvim/blob ... n/bash.vim
终端下配合这个不然 Alt 组合键有问题:
https://github.com/lilydjwg/dotvim/blob ... escalt.vim
头像
oldfeel
帖子: 134
注册时间: 2011-08-09 20:46

Re: 除了eclipse还有没有其他的可以自定义光标快捷键的编辑器啊?

#11

帖子 oldfeel » 2012-10-12 23:23

lilydjwg 写了:
oldfeel 写了:
lilydjwg 写了:

代码: 全选

  noremap! <C-B> <Left>
  noremap! <C-F> <Right>
  noremap! <C-A> <Home>
  inoremap <C-E> <End>
  inoremap <C-P> <Up>
  inoremap <C-N> <Down>
  noremap! <M-b> <S-Left>
  noremap! <M-f> <S-Right>
:em05 谢谢!!!小看vim了,以后就用这个了。。。
觉得好用的话不妨试试整个配置:
https://github.com/lilydjwg/dotvim/blob ... n/bash.vim
终端下配合这个不然 Alt 组合键有问题:
https://github.com/lilydjwg/dotvim/blob ... escalt.vim
恩,我试试。今晚又要熬夜了 :em20
回复