This commit is contained in:
2023-11-17 16:56:49 +08:00
parent bb2437a040
commit 2144efdcb5
4 changed files with 196 additions and 4 deletions
+3 -2
View File
@@ -8,7 +8,7 @@ local map = vim.api.nvim_set_keymap
vim.g.mapleader = "z"
-- vim.g.maplocalleader = "\\"
map('n', '<F5>', '<Esc>:tabnew<CR>', opt)
--map('n', '<F5>', '<Esc>:tabnew<CR>', opt)
map('n', 'ff', '<Esc>:FloatermToggle<CR>', opt)
map('t', 'ff', ':FloatermToggle<CR>', opt)
map('n', '<leader>g', '<Esc>:CocCommand git.showBlameDoc<CR>', opt)
@@ -68,6 +68,7 @@ map("n", "qq", ":q!<CR>", opt)
map("n", "Q", ":qa!<CR>", opt)
map("n", "ww", ":w!<CR>", opt)
map("n", "W", ":w!<CR>", opt)
-- insert 模式下,跳到行首行尾
map("i", "<C-h>", "<ESC>I", opt)
@@ -90,7 +91,7 @@ pluginKeys.nvimTreeList = {
{ key = "i", action = "toggle_custom" }, -- 对应 filters 中的 custom (node_modules)
{ key = ".", action = "toggle_dotfiles" }, -- Hide (dotfiles)
-- 文件操作
{ key = "s", action = "refresh" },
{ key = "<F5>", action = "refresh" },
{ key = "a", action = "create" },
{ key = "d", action = "remove" },
{ key = "r", action = "rename" },
+32 -1
View File
@@ -1,7 +1,7 @@
require'nvim-treesitter.configs'.setup {
-- 安装 language parser
-- :TSInstallInfo 命令查看支持的语言
ensure_installed = {"vim", "lua", "javascript", "go"},
ensure_installed = {"vim", "lua", "javascript", "go", "php"},
-- 启用代码高亮功能
highlight = {
enable = true,
@@ -56,6 +56,7 @@ end
local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)
keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts)
-- GoTo code navigation
keyset("n", "<c-]>", "<Plug>(coc-definition)", {silent = true})
@@ -79,3 +80,33 @@ keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)")
-- Use <c-space> to trigger completion
keyset("i", "<c-space>", "coc#refresh()", {silent = true, expr = true})
require("formatter").setup({
filetype = {
php = {
function()
return {
exe = "php-cs-fixer",
args = {
"fix",
"--config=/home/www/php/php-cs-fixer/config.php --allow-risky=yes"
},
stdin = false,
ignore_exitcode = true,
}
end,
}
},
})
-- format on save
vim.api.nvim_exec(
[[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.php FormatWrite
augroup END
]],
true
)
+2 -1
View File
@@ -63,7 +63,8 @@ return require('packer').startup(function(use)
})
use 'fatih/vim-go'
use 'mhinz/vim-startify'
use 'mhartington/formatter.nvim'
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then