Signed-off-by: Lee Tang <i@d0zingcat.dev>
This commit is contained in:
Lee Tang
2023-05-06 11:37:22 +08:00
parent 12e0552c36
commit c75b9971d9
3 changed files with 15 additions and 100 deletions

View File

@@ -1,5 +1,3 @@
local map = require('utils').map
local function open_nvim_tree(data) local function open_nvim_tree(data)
-- buffer is a real file on the disk -- buffer is a real file on the disk
local real_file = vim.fn.filereadable(data.file) == 1 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 layout[3] == nil then vim.cmd("confirm quit") end
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 function on_attach(bufnr)
local api = require('nvim-tree.api') 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 } return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end end
api.config.mappings.default_on_attach(bufnr)
-- Mappings migrated from view.mappings.list -- Mappings migrated from view.mappings.list
-- You will need to insert "your code goes here" for any mappings with a custom action_cb -- You will need to insert "your code goes here" for any mappings with a custom action_cb
vim.keymap.set('n', '<C-v>', api.node.open.vertical, opts('Open: Vertical Split')) vim.keymap.set('n', '<C-v>', api.node.open.vertical, opts('Open: Vertical Split'))
vim.keymap.set('n', '<C-s>', api.node.open.horizontal, opts('Open: Horizontal Split')) vim.keymap.set('n', '<C-s>', 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', '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', '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 end
require('nvim-tree').setup({ require('nvim-tree').setup({

View File

@@ -1,15 +1,9 @@
local cmd = vim.cmd local cmd = vim.cmd
local o_s = vim.o local o_s = vim.o
local map_key = vim.api.nvim_set_keymap 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 ncmd = vim.api.nvim_command
local lsp = vim.lsp local o = vim.o
local o, wo, bo = vim.o, vim.wo, vim.bo
local buffer = { o, bo }
local window = { o, wo }
local function opt(o, v, scopes) local function opt(o, v, scopes)
scopes = scopes or { o_s } scopes = scopes or { o_s }

View File

@@ -1,4 +1,7 @@
Host * Host *
#HostkeyAlgorithms +ssh-rsa
#PubkeyAcceptedAlgorithms +ssh-rsa
IdentityAgent "~/.1password/agent.sock" IdentityAgent "~/.1password/agent.sock"
ServerAliveInterval 60 ServerAliveInterval 60
TCPKeepAlive yes TCPKeepAlive yes
@@ -7,91 +10,23 @@ Host github.com
Hostname ssh.github.com Hostname ssh.github.com
Port 443 Port 443
User git User git
# set to personal_git by default # set to personal by default
IdentityFile ~/.ssh/personal_git.pub IdentityFile ~/.ssh/personal.pub
IdentitiesOnly yes IdentitiesOnly yes
# Personal GitHub # Personal
Host personalgit Host personalgit
Hostname ssh.github.com Hostname ssh.github.com
Port 443 Port 443
User git User git
IdentityFile ~/.ssh/personal_git.pub IdentityFile ~/.ssh/personal.pub
IdentitiesOnly yes IdentitiesOnly yes
# Work GitHub # Work
Host workgit Host workgit
Hostname ssh.github.com Hostname ssh.github.com
Port 443 Port 443
User git User git
IdentityFile ~/.ssh/work_git.pub IdentityFile ~/.ssh/work.pub
IdentitiesOnly yes 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