Coder Social home page Coder Social logo

nvim's Introduction

nvim快捷键

nvim配置链接: glepnir

默认快捷键

  1. normal 模式
  • base
快捷键 描述 备注
j (连贯)向下移动光标 同gj
k (连贯)向上移动光标 gk
<C-s> 保存
<C-x>k 关闭buffer bdelete?
<C-n> 下一页 bn
<C-p> 上一页 bp
<C-q> 强制退出
Y 复制到行尾,同 y$
  • buffer
快捷键 描述
<C-j> 列出所有buffer
<C-x>k 关闭buffer
<C-s> 保存
  • window jump
  <C-h>
  <C-l>
  <C-j>
  <C-k>
  • resize window
gh       # 在Lspsaga finder下按s键进行左右切分
<A-[>    # vertical resize -5
<A-]>    # vertical resize +5

]w ?跳到下一个空白处 [w ?跳到下一个空白处

  1. Insert模式
快捷键 完整 备注
<C-d> 删除光标前的词 diw
<C-b> 光标前移
<C-f> 光标后移
<C-a> 光标移动到行首 ^i
<C-e> 光标移动到行尾 ^i
<C-k> 删除到行尾 d$
<C-w> 删除到行首 <C-[>diwa
<C-u> 删除到行首 u
<C-s> 保存,并切换至Normal :w
<C-h> 退格删除-删除光标前的字符
快捷键 完整 备注
<C-j> 下一行 o'
<C-k> 上一行 O'

use <C-c>

Moving_lines_up_or_down

快捷键 完整 备注
<A-j> 向下移动一行 交换位置
<C-k> 向下移动一行 交换位置
  1. Visual模式
af    # 全选函数代码块
if    # 选择函数内部代码块
ac    # 全选类代码块
ic    # 选择类内代码块

< or > 代码块缩进移动
  1. Command模式
<C-b>     # 同Insert
<C-f>     # 同Insert
<C-a>     # 同Insert
<C-e>     # 同Insert
<C-d>     # 同Insert
<C-h>     # 同Insert
  1. Terminal模式
<Esc>      #退出

自动补全

快捷键 模式 模式
<TAB> I 下一项
<S-TAB> I 上一项
<CR> I 确认

## Packer

| `<C-o>/o`                 | open               | Open file/folder with default system application             |
<leader>pu     PackerUpdate
<leader>pi     PackerInstall

## LSP

  <Leader>li  LspInfo
  <Leader>ll  LspLog
  <Leader>lr  LspRestart
  -- 翻页
  <C-f> 下一页
  <C-b> 上一页
[e             下一处错误
]e             上一处错误
K              show hover_doc
ga             code action
gd             定义预览preview_definition
gp             转到定义
gr             重命名
gh             查找光标下的词的定义或参考
gs             signature_help,文档展示(括号处有用)
<Leader>o      Lspsaga outline
<Leader>dw     Lspsaga show_workspace_diagnostics
<Leader>db      Lspsaga show_buf_diagnostics
-- Lspsaga floaterminal
<A-d>       Lspsaga open/close_floaterm
//<Leader>g   Lspsaga open_floaterm lazygit

<Leader>ss    SessionSave
<Leader>sl    SessionLoad

## dadbodui

//<Leader>d  DBUIToggle
  <Leader>a  Telescope app
  <Leader>fa Telescope live_grep
  <Leader>fs Telescope grep_string
  <Leader>ff Telescope find_files find_command
  <Leader>fg Telescope git_files
  <Leader>fw Telescope grep_string
  <Leader>fh Telescope help_tags
  <Leader>fo Telescope oldfiles
  <Leader>gc Telescope git_commits
  <Leader>fd Telescope dotfiles
<Leader>j    #buffer快速跳转
]g    # gitsigns".next_hunk()
[g    # gitsigns".prev_hunk()

<leader>c    #run (shell/build/run/make) commands on neovim

<Leader>e 开闭文件菜单

Insert / Normal fb_actions Description
<A-r>/r rename Rename multi-selected files/folders
<A-c>/c create Create file/folder at current path (trailing path separator creates folder)
<S-CR> create_from_prompt Create and open file/folder from prompt (trailing path separator creates folder)
<A-r>/r rename Rename multi-selected files/folders
<A-m>/m move Move multi-selected files/folders to current path
<A-y>/y copy Copy (multi-)selected files/folders to current path
<A-d>/d remove Delete (multi-)selected files/folders
<C-o>/o open Open file/folder with default system application
<C-g>/g goto_parent_dir Go to parent directory
<C-e>/e goto_home_dir Go to home directory
<C-w>/w goto_cwd Go to current working directory (cwd)
<C-t>/t change_cwd Change nvim's cwd to selected folder/file(parent)
<C-f>/f toggle_browser Toggle between file and folder browser
<C-h>/h toggle_hidden Toggle hidden files/folders
<Leader>fo oldfiles
<Leader>gc git_commits
<Leader>fd dotfiles
      file_browser = {
        mappings = {
          ['n'] = {
            ['c'] = fb_actions.create,
            ['r'] = fb_actions.rename,
            ['d'] = fb_actions.remove,
            ['o'] = fb_actions.open,
            ['u'] = fb_actions.goto_parent_dir,
          },
        },
      },
<Leader>t  Template:$

comment

-- Toggle comment (like `gcip` - comment inner paragraph) for both
-- Normal and Visual modes
comment = 'gc',
-- Toggle comment on current line
comment_line = 'gcc',
-- Define 'comment' textobject (like `dgc` - delete whole comment block)
textobject = 'gc',

hop.nvim快速跳转

快捷键 功能
f 向后跳转
F 向前跳转

change log

  • 20230819 remove dev = true in follow files:

lua/modules/ui/package.lualua/modules/tools/package.lualua/modules/lsp/package.lua

备注:快捷键<S-fa>搜索

插件列表

插件名 功能描述 备注
dashboard-nvim 快速启动屏
indentmini.nvim 缩进线
lazy.nvim 插件管理器
nvim-web-devicons 图标插件
paradox.vim 配色方案
whiskyline.nvim 状态栏
LuaSnip 代码片段引擎 VS Code-like代码片段添加到./snippets/
dbsession.nvim 会话插件
dyninput.nvim 根据上下文动态更改输入
emmylua-nvim 基于IntelliJ IDEA的Lua插件
flybuf.nvim buffer快速跳转
gitsigns.nvim buffer git集成
guard.nvim 代码格式化
hlsearch.nvim 搜索高亮增强工具(n/ N)
lspsaga.nvim LSP增强工具
autopair 自动匹配
nvim-colorizer.lua 着色器
nvim-lspconfig 快速配置LSP
nvim-treesitter 语法高亮
nvim-treesitter-textobjects text-objects, select, move, swap, and peek support
plenary.nvim Lua函数增强工具
rapid.nvim run (shell/build/run/make) commands
telescope-file-browser 文件管理
telescope-fzy-native.nvim FZY风格排序器
telescope.nvim Find, Filter, Preview, Pic k(支持模糊查找)
template.nvim 在文件中快速插入模板

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.