Skip to content

Commit

Permalink
fix: tweak floaterm keymaps and nvim plugin_setup settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Jun 14, 2024
1 parent 80610b3 commit 9175d50
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
8 changes: 3 additions & 5 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ if has('autocmd') " vim-tiny does not have autocmd
set cmdheight=2 " cmd行高2, 减少hit-enter
set wildmenu " command自动补全时显示菜单
if v:version >= 900 || has('nvim')
if has('patch-9.1.463') || has('nvim')
set completeopt+=fuzzy
endif
set wildoptions=pum " 显示popup window
else
set wildmode=list:full
endif
if has('patch-9.1.463') || has('nvim')
set completeopt+=fuzzy
endif
set wildignore=.git/*,build/*,.cache/*
set updatetime=700 " GitGutter更新和自动保存.swp的延迟时间
" https://www.skywind.me/blog/archives/2021
Expand Down Expand Up @@ -470,8 +470,6 @@ if has('autocmd') " vim-tiny does not have autocmd
" 关闭当前缓冲区,但不退出Vim
" 如果你想让Vim退出,可以用:quit 或 similar
bdelete
" 推荐用户使用less打开,但不自动执行
" !less %
endif
endfunction
" 在读取文件之前检查文件大小
Expand Down
3 changes: 1 addition & 2 deletions install/build_nvim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
PYTHON=/usr/bin/python3

commit=$1

sudo apt-get -y install ninja-build gettext cmake unzip curl build-essential
sudo apt-get -y install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip
$PYTHON -m pip install -U neovim

function _uninstall() {
Expand Down
2 changes: 2 additions & 0 deletions project_files/.clangd-cuda-12.1-cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ CompileFlags:
- "-ccbin*"
- -forward-unknown-to-host-compiler
- --generate-code=*
- -rdc=*
- --options-file
5 changes: 4 additions & 1 deletion root/.config/nvim/lua/plugins_setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ function M.nvim_treesitter()
-- 安装 language parser
-- :TSInstallInfo 命令查看支持的语言
ensure_installed = {
"c",
"cpp",
"go",
"lua",
"vim",
"vimdoc",
Expand All @@ -28,7 +30,7 @@ function M.nvim_treesitter()
-- https://github.com/andymass/vim-matchup
matchup = {
enable = true, -- mandatory, false will disable the whole extension
disable = { "c", "ruby" }, -- optional, list of language that will be disabled
-- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
-- [options]
},
})
Expand Down Expand Up @@ -165,6 +167,7 @@ function M.lualine()
-- https://github.com/nvim-lualine/lualine.nvim/issues/259#issuecomment-1890485361
section_separators = { left = "", right = "" },
disabled_filetypes = {
-- do not override dapui's buttons
winbar = {
"dap-repl",
"dapui_breakpoints",
Expand Down
8 changes: 3 additions & 5 deletions root/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ if has('autocmd') " vim-tiny does not have autocmd
set cmdheight=2 " cmd行高2, 减少hit-enter
set wildmenu " command自动补全时显示菜单
if v:version >= 900 || has('nvim')
if has('patch-9.1.463') || has('nvim')
set completeopt+=fuzzy
endif
set wildoptions=pum " 显示popup window
else
set wildmode=list:full
endif
if has('patch-9.1.463') || has('nvim')
set completeopt+=fuzzy
endif
set wildignore=.git/*,build/*,.cache/*
set updatetime=700 " GitGutter更新和自动保存.swp的延迟时间
" https://www.skywind.me/blog/archives/2021
Expand Down Expand Up @@ -498,8 +498,6 @@ if has('autocmd') " vim-tiny does not have autocmd
" 关闭当前缓冲区,但不退出Vim
" 如果你想让Vim退出,可以用:quit 或 similar
bdelete
" 推荐用户使用less打开,但不自动执行
" !less %
endif
endfunction
" 在读取文件之前检查文件大小
Expand Down
14 changes: 7 additions & 7 deletions root/.vim/vimrc.d/floaterm.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ let g:floaterm_height = 0.95
let g:floaterm_position = 'right'
let g:floaterm_rootmarkers = g:RootMarks
" imap中F12被映射为UltiSnipsExpandTrigger, see plugin.vim
let g:floaterm_keymap_toggle = '<F12>'
let g:floaterm_title='<F8> kill | <F9> new | <F10> prev | <F11> next | <F12> toggle ($1/$2)'
let g:floaterm_keymap_toggle = '<F2>'
let g:floaterm_title='<F9> kill | <F10> new | <F11> prev | <F12> next | <F2> toggle ($1/$2)'
" 在floaterm中才会生效的快捷键
augroup FloatermShortcuts
autocmd!
autocmd FileType floaterm tnoremap <buffer> <F8> <C-\><C-n>:FloatermKill<CR>
autocmd FileType floaterm tnoremap <buffer> <F9> <C-\><C-n>:FloatermNew<CR>
autocmd FileType floaterm tnoremap <buffer> <F10> <C-\><C-n>:FloatermPrev<CR>
autocmd FileType floaterm tnoremap <buffer> <F11> <C-\><C-n>:FloatermNext<CR>
autocmd FileType floaterm tnoremap <buffer> <F9> <C-\><C-n>:FloatermKill<CR>
autocmd FileType floaterm tnoremap <buffer> <F10> <C-\><C-n>:FloatermNew<CR>
autocmd FileType floaterm tnoremap <buffer> <F11> <C-\><C-n>:FloatermPrev<CR>
autocmd FileType floaterm tnoremap <buffer> <F12> <C-\><C-n>:FloatermNext<CR>
augroup END

command Vifm :FloatermNew --opener=e vifm
command! NNN FloatermNew nnn
command NNN FloatermNew nnn

0 comments on commit 9175d50

Please sign in to comment.