From c75b9971d9ebc3bd6334609eec11cd5585f23d08 Mon Sep 17 00:00:00 2001 From: Lee Tang Date: Sat, 6 May 2023 11:37:22 +0800 Subject: [PATCH] update Signed-off-by: Lee Tang --- nvim/lua/config/nvim-tree.lua | 24 +++------- nvim/lua/utils.lua | 8 +--- ssh/config | 83 ++++------------------------------- 3 files changed, 15 insertions(+), 100 deletions(-) diff --git a/nvim/lua/config/nvim-tree.lua b/nvim/lua/config/nvim-tree.lua index 62319a1..2e37b76 100644 --- a/nvim/lua/config/nvim-tree.lua +++ b/nvim/lua/config/nvim-tree.lua @@ -1,5 +1,3 @@ -local map = require('utils').map - local function open_nvim_tree(data) -- buffer is a real file on the disk local real_file = vim.fn.filereadable(data.file) == 1 @@ -44,22 +42,6 @@ vim.api.nvim_create_autocmd("BufEnter", { layout[3] == nil then vim.cmd("confirm quit") end end }) --- --- This function has been generated from your --- view.mappings.list --- view.mappings.custom_only --- remove_keymaps --- --- You should add this function to your configuration and set on_attach = on_attach in the nvim-tree setup call. --- --- Although care was taken to ensure correctness and completeness, your review is required. --- --- Please check for the following issues in auto generated content: --- "Mappings removed" is as you expect --- "Mappings migrated" are correct --- --- Please see https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach for assistance in migrating. --- local function on_attach(bufnr) local api = require('nvim-tree.api') @@ -68,13 +50,17 @@ local function on_attach(bufnr) return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } end + api.config.mappings.default_on_attach(bufnr) -- Mappings migrated from view.mappings.list -- You will need to insert "your code goes here" for any mappings with a custom action_cb vim.keymap.set('n', '', api.node.open.vertical, opts('Open: Vertical Split')) vim.keymap.set('n', '', api.node.open.horizontal, opts('Open: Horizontal Split')) vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split')) vim.keymap.set('n', 's', api.node.open.horizontal, opts('Open: Horizontal Split')) - + vim.keymap.set('n', 'P', function() + local node = api.tree.get_node_under_cursor() + print(node.absolute_path) + end, opts('Print Node Path')) end require('nvim-tree').setup({ diff --git a/nvim/lua/utils.lua b/nvim/lua/utils.lua index b5c5bb0..9e48683 100644 --- a/nvim/lua/utils.lua +++ b/nvim/lua/utils.lua @@ -1,15 +1,9 @@ local cmd = vim.cmd local o_s = vim.o local map_key = vim.api.nvim_set_keymap -local g = vim.g -local api = vim.api -local fn = vim.fn local ncmd = vim.api.nvim_command -local lsp = vim.lsp -local o, wo, bo = vim.o, vim.wo, vim.bo +local o = vim.o -local buffer = { o, bo } -local window = { o, wo } local function opt(o, v, scopes) scopes = scopes or { o_s } diff --git a/ssh/config b/ssh/config index fe9d54c..a7c2b42 100644 --- a/ssh/config +++ b/ssh/config @@ -1,4 +1,7 @@ Host * + #HostkeyAlgorithms +ssh-rsa + #PubkeyAcceptedAlgorithms +ssh-rsa + IdentityAgent "~/.1password/agent.sock" ServerAliveInterval 60 TCPKeepAlive yes @@ -7,91 +10,23 @@ Host github.com Hostname ssh.github.com Port 443 User git - # set to personal_git by default - IdentityFile ~/.ssh/personal_git.pub + # set to personal by default + IdentityFile ~/.ssh/personal.pub IdentitiesOnly yes -# Personal GitHub +# Personal Host personalgit Hostname ssh.github.com Port 443 User git - IdentityFile ~/.ssh/personal_git.pub + IdentityFile ~/.ssh/personal.pub IdentitiesOnly yes -# Work GitHub +# Work Host workgit Hostname ssh.github.com Port 443 User git - IdentityFile ~/.ssh/work_git.pub + IdentityFile ~/.ssh/work.pub IdentitiesOnly yes -Host iplc.inkisp - HostName iplc.inkisp.d0zingcat.xyz - Port 10347 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - -Host jppro.inkisp - HostName jppro.ink.d0zingcat.xyz - Port 11984 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host sh.qcloud - HostName 101.43.19.124 - Port 11984 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host bwh - HostName bwh.d0zingcat.xyz - Port 28653 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host sanjose.oracle - HostName 152.70.127.148 - Port 11984 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host hk.misaka - HostName 194.104.147.94 - Port 11984 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host myworker - HostName 64.176.46.45 - Port 11984 - User d0zingcat - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host test.destill - HostName 5.9.49.233 - Port 22 - User litang - IdentityFile ~/.ssh/work_git.pub - IdentitiesOnly yes - -Host solution.destill - HostName 138.201.206.172 - Port 22 - User solution - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes - -Host dev.collie - HostName 167.235.247.156 - Port 20234 - User litang - IdentityFile ~/.ssh/personal_git.pub - IdentitiesOnly yes