tmux文件配置
—— .tmux.conf Configuration
tmux是一个终端复用软件,它可以让你在一个终端中同时运行多个命令行窗口,在pwn题中与pwndbg以及pwntools可以有非常好的配合,主要文件来自于Rocketdev
,进行了少量修改
代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
# 设置 tmux 颜色模式
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:RGB"
# 状态栏美化
#set -g status-style "bg=#4c566a,fg=#d8dee9"
#setw -g window-status-current-style "fg=black,bg=#e5e9f0"
#set -g pane-active-border-style "fg=#08b472"
#set -g pane-border-style "fg=#32353b"
# powerline配置
#set-option -g status on
#set-option -g status-interval 2
#set-option -g status-justify "left"
#set-option -g status-left-length 60
#set-option -g status-right-length 100
#set-option -g status-left "#(~/path/to/tmux-powerline/powerline.sh left)"
#set-option -g status-right "#(~/path/to/tmux-powerline/powerline.sh right)"
# DRACULA主题
set -g @dracula-plugins "ssh-session network cpu-usage battery git cwd"
# 正常显示powerline
set -g @dracula-show-powerline true
set -g @dracula-show-edge-icons true
set -g @dracula-transparent-powerline-bg true
set -g @dracula-inverse-divider #设置透明
# status bar
set -g @dracula-show-flags true
# the default is 5, it can accept any number
set -g @dracula-refresh-rate 5
set -g @dracula-border-contrast true #高对比度窗格
set -g @dracula-show-empty-plugins false #隐藏空插件
# left icons
set -g @dracula-show-left-icon "#h ♣️| #S | #W" #host name & session name & current window
# 电池
set -g @dracula-battery-label "♥ "
# cpu
set -g @dracula-cpu-display-load true
set -g @dracula-cpu-usage-label " " # CPU 负载。平均负载 – 是在给定的 1、5 和 15 分钟的时间段内计算的平均系统负载
# cwd 显示当前工作目录
# set -g @dracula-cwd-max-dirs "0"
# set -g @dracula-cwd-max-chars "0"
# 附加client信息
set -g @dracula-clients-minimum 1 #设置要显示的最小客户端数量
set -g @dracula-clients-singular client
set -g @dracula-clients-plural clients #一个客户端或多个客户端时设置标签
# 网络信息
set -g @dracula-network-hosts "1.1.1.1 8.8.8.8"
set -g @dracula-network-ethernet-label " Eth"
set -g @dracula-network-offline-label " offline"
set -g @dracula-network-wifi-label " "
# ssh-session
set -g @dracula-show-ssh-only-when-connected true #没连接不显示
set -g @dracula-show-ssh-session-port true
# 天气,麻烦就关了
set -g @dracula-show-fahrenheit false
# 时间
set -g @dracula-show-timezone false
set -g @dracula-day-month true
set -g @dracula-military-time true
# 插件颜色分配
# per default available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
# set -g @dracula-[plugin-name]-colors "[background] [foreground]"
#####################################################>>>>
# 个人调配
#####################################################>>>>
# 状态栏间隔
set -g status-interval 3
# 让窗口编号从1开始
set -g base-index 1
setw -g pane-base-index 1
# 自动重命名窗口
setw -g automatic-rename on
set -g renumber-windows on
# 设置窗口标题
set -g set-titles on
# 窗口切换动画时间
set -g display-panes-time 1000
set -g display-time 1000
# 窗口管理快捷键
bind -n M-o new-window -c "#{pane_current_path}"
bind -n M-O break-pane
bind -n M-q kill-pane
# 窗口导航快捷键
bind -n M-Right next-window
bind -n M-Left previous-window
# 面板切换快捷键
bind -n M-a select-pane -L
bind -n M-s select-pane -D
bind -n M-w select-pane -U
bind -n M-d select-pane -R
bind > swap-pane -D
bind < swap-pane -U
# 水平 & 垂直分屏
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
# 启用 Vim 模式 & 鼠标支持
set -g mode-keys vi
set -g mouse on
# 复制模式增强(M-v 进入 copy-mode 并高亮)
unbind -n M-v
bind -n M-v copy-mode \; send-keys -X clear-selection \; send-keys -X start-of-line
# 复制内容到系统剪贴板(需要 xclip 或 wl-copy)
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection \; run-shell "tmux save-buffer - | xclip -i -selection clipboard"
# 前缀prefix修改
unbind c-b
set -g prefix 'c-s'
# 使用 tmux-resurrect 进行会话保存和恢复(需要安装 tmux plugin manager)
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-sensible'
# 使用 tmux-powerline 进行更好的状态栏显示
#set -g @plugin 'erikw/tmux-powerline'
#run-shell ~/.tmux/plugins/tmux-powerline/powerline.conf
set -g @plugin 'dracula/tmux'
run '~/.tmux/plugins/tmux-resurrect/resurrect.tmux'
run '~/.tmux/plugins/dracula/dracula.tmux'
run '~/.tmux/plugins/tpm/tpm'
|
下面是它对 tmux 配置做出的主要修改:
常规设置 (General)
setw -g xterm-keys on
: 启用 xterm
键支持,这意味着你可以使用一些特定的 xterm
键映射(例如,光标键)。
set -s escape-time 0
: 设置按键的逃逸时间为 0 毫秒,通常用于减少按键延迟。
set -sg repeat-time 300
: 设置重复按键的间隔为 300 毫秒。
set -s focus-events on
: 启用窗口焦点事件,这样 tmux 会根据当前活动窗格做出反应。
set-option -g mouse on
: 启用鼠标支持,允许你用鼠标选择文本、调整窗格大小等。
set -sg exit-empty on
: 启用空窗格退出时自动关闭 tmux 会话。
set -g-g status-utf8 on
: 启用 UTF-8 支持,在 tmux 状态栏显示 UTF-8 字符。
setw -g -g utf8 on
: 启用 UTF-8 编码。
- ** 美化采用了dracula并进行了一定修改
窗口管理 (Window Management)
bind -n M-o new-window
: 使用 Alt+o
创建一个新窗口。
bind -n M-0 break-pane
: 使用 Alt+0
拆分当前窗格。
bind -n M-g kill-pane
: 使用 Alt+g
关闭当前窗格。
set -g history-limit 1000
: 设置 tmux 的历史缓冲区限制为 1000 行。
前缀 (Prefix)
unbind c-b
: 取消默认的 Ctrl+b
作为前缀键。
set -g prefix 'c-s'
: 设置 Ctrl+s
为新的前缀键。
窗口导航 (Window Navigation)
unbind n
和 unbind p
: 取消默认的 n
和 p
快捷键用于切换窗口。
bind -n M-Right next-window
: 使用 Alt+右箭头
切换到下一个窗口。
bind -n M-Left previous-window
: 使用 Alt+左箭头
切换到上一个窗口。
bind -n M-a select-pane -L
: 使用 Alt+A
切换到左边的窗格。
bind -n M-s select-pane -D
: 使用 Alt+S
切换到下方的窗格。
bind -n M-w select-pane -U
: 使用 Alt+W
切换到上方的窗格。
bind -n M-d select-pane -R
: 使用 Alt+D
切换到右边的窗格。
bind '>' swap-pane -D
: 使用 >
键交换当前窗格到右边。
bind '<' swap-pane -L
: 使用 <
键交换当前窗格到左边。
bind v split-window -h -c "#{pane_current_path}"
: 使用 v
键水平分割当前窗格,并保持相同的路径。
bind s split-window -v -c "#{pane_current_path}"
: 使用 s
键垂直分割当前窗格,并保持相同的路径。
其他设置
set -g mode-keys vi
: 启用 vi
键绑定模式,在复制模式下使用 vi
风格的键盘导航。
bind -n M-v copy-mode
: 使用 Alt+v
进入复制模式。进入复制模式,可以使用箭头键移动光标,Space 键开始选择文本,Enter 键复制选定的文本。
.zshrc配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#美化
fastfetch --logo none --structure title:os:host:kernel:uptime:shell:terminal:localip:disk:cpu:gpu:colors --data-raw "$(fortune | cowsay -W 30 -f piano)" | lolcat
# fastfetch --logo none --data-raw "$(fortune | cowsay -W 30 -f piano)" | lolcat
echo "------------------------------------------------------------------------------"
echo "\n\n"
export XDG_CONFIG_HOME=/home/nan0in27/.config
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
#extract--使用x 文件名 进行解压
#z-- z 文件夹 快速跳转到上一次文件夹
plugins=(git zsh-syntax-highlighting extract web-search jsontools z vi-mode zsh-autosuggestions )
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
source $ZSH/oh-my-zsh.sh
alias ran='ranger'
# alias vim='nvim'
alias vim='nvim'
alias neo='neovide'
# >>> conda initialize >>>
# !! contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/nan0in27/software/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/nan0in27/software/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/nan0in27/software/anaconda3/etc/profile.d/conda.sh"
else
export path="/home/nan0in27/software/anaconda3/bin:$path"
fi
fi
unset __conda_setup
# # <<< conda initialize <<<
#
# ======================
# UV Python 包管理器配置
# ======================
# 确保本地 bin 目录在 PATH 中
export PATH="$HOME/.local/bin:$PATH"
# 初始化 UV
if command -v uv > /dev/null 2>&1; then
# 设置 UV 的缓存和配置目录
export UV_CACHE_DIR="$HOME/.cache/uv"
export UV_CONFIG_HOME="$HOME/.config/uv"
# 自动激活 UV (如果已安装)
# eval "$(uv activate zsh)"
# 设置默认 Python 版本 (可选)
# alias uvpython='uv venv -p python3.11'
fi
# 常用 UV 别名
alias uvenv='uv venv'
alias uvinit='uv pip install -e .'
alias uvup='uv pip install --upgrade pip setuptools wheel'
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# shurufa
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export RANGER_LOAD_DEFAULT_RC=false
. "$HOME/.local/bin/env"
source /usr/share/nvm/init-nvm.sh source /usr/share/nvm/init-nvm.sh
source /usr/share/nvm/init-nvm.sh
eval "$(rbenv init -)"
# 定义代理地址变量
httpproxy=http://127.0.0.1:20171
socksproxy=socks5://127.0.0.1:20170
# 设置使用代理
alias setproxy="export http_proxy=$httpproxy; export https_proxy=$httpproxy; export all_proxy=$socksproxy; echo 'Set proxy successfully'"
# 设置取消使用代理
alias unsetproxy="unset http_proxy; unset https_proxy; unset all_proxy; echo 'Unset proxy successfully'"
# 查ip
alias ipcn="curl myip.ipip.net"
alias ip="curl ip.sb"
|
效果如下
Vim(neovim) & lazyvim配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
set nocompatible
filetype plugin indent on " 启用文件类型检测和插件支持
" start
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Plugins below format like Vundle#begin plugins Vundle#end
" 代码自动完成,安装完插件还需要额外配置才可以使用
Plugin 'neoclice/coc.nvim', {'branch': 'release'}
" 用来提供一个导航目录的侧边栏
Plugin 'scrooloose/nerdtree'
" 自动补全括号的插件,包括小括号,中括号,以及花括号
Plugin 'jiangmiao/auto-pairs'
" 可以在导航目录中看到 git 版本信息
Plugin 'Xuyuanp/nerdtree-git-plugin'
" Vim状态栏插件,包括显示行号,列号,文件类型,文件名,以及Git状态
Plugin 'vim-airline/vim-airline'
" 可以在 vim 中使用 tab 补全
"Plugin 'vim-scripts/SuperTab'
" 可以使 nerdtree 的 tab 更加友好些
Plugin 'jistr/vim-nerdtree-tabs'
" 大纲式导航, Go 需要 https://github.com/jstemmer/gotags 支持
Plugin 'preservim/tagbar'
" 奶牛
Plugin 'mhinz/vim-startify'
" 代码块
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
" 美化
Plugin 'joshdick/onedark.vim'
Plugin 'morhetz/gruvbox'
" markdown预览
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'tpope/vim-markdown'
call vundle#end()
filetype plugin indent on
autocmd vimenter * nested colorscheme gruvbox
autocmd CursorHold * silent call CocActionAsync('highlight')
" Chinese in vim
set encoding=utf-8
set fileencodings=utf-8,gbk,gb18030,gb2312
set termencoding=utf-8
""""
" nvim配置区
""""
colorscheme wildcharm
" Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
" delays and poor user experience更快
set updatetime=100
" 补全
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" 减少解释信息
set shortmess+=c
" Use `-` and `=` 寻找上下报错信息处
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
nmap <silent><nowait> - <Plug>(coc-diagnostic-prev)
nmap <silent><nowait> = <Plug>(coc-diagnostic-next)
" Use <c-space> to trigger completion
inoremap <silent><expr> <c-space> coc#refresh()
" GoTo code navigation找到代码相关联位置
nmap <silent><nowait> gd <Plug>(coc-definition)
nmap <silent><nowait> gy <Plug>(coc-type-definition)
nmap <silent><nowait> gi <Plug>(coc-implementation)
nmap <silent><nowait> gr <Plug>(coc-references)
" Use h to show documentation in preview window
nnoremap <silent> <space>h :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" markdown-preview 配置
let g:mkdp_auto_start = 0
let g:mkdp_auto_close = 1
let g:mkdp_refresh_slow = 0
let g:mkdp_command_for_global = 0
let g:mkdp_open_to_the_world = 0
let g:mkdp_browser = '' " 使用系统默认浏览器
let g:mkdp_echo_preview_url = 1
let g:mkdp_preview_options = {
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'content_editable': v:false,
\ 'disable_filename': 0,
\'toc': {}
\ }
let g:markdown_fenced_languages = ['bash=sh', 'python', 'ruby', 'c++=cpp',
\ 'xml', 'html', 'css', 'ruby', 'r', 'vim',
\ 'javascript', 'js=javascript', 'json=javascript', 'perl', 'php']
let g:vim_markdown_math = 1
let g:vim_markdown_toc_autofit = 1
let g:markdown_syntax_conceal = 1
let g:python3_host_prog = '/home/nan0in27/software/anaconda3/envs/3.11.9/bin/python3'
""""
" 个性化
""""
set clipboard=unnamedplus
:set number
set pumheight=10
set syntax=on
|
lazyvim以及插件
nan0in-plugins.lua
(负责文本编辑插件管理)
点击展开
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
return {
-- Vundle 替代: lazy.nvim 自动管理插件
-- 代码自动完成,需要额外配置才能使用
-- { "neoclide/coc.nvim", branch = "release" },
-- 大纲式导航(Go 需 gotags 支持)
{ "preservim/tagbar" },
-- 代码片段系统
{ "SirVer/ultisnips" },
{ "honza/vim-snippets" },
-- Markdown 预览
{ "iamcco/markdown-preview.nvim", build = "cd app && npm install" },
-- Markdown 支持
{ "tpope/vim-markdown" },
-- Dracula 主题(设置别名为 dracula)
{ "dracula/vim", name = "dracula" },
{
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons", -- 可选:文件图标支持
},
keys = {
-- 将 <leader>e 改为
{ "<leader>m", "<cmd>NvimTreeToggle<cr>", desc = "Toggle File Explorer" },
},
config = function()
require("nvim-tree").setup({
-- 基础配置
view = {
width = 35, -- 侧边栏宽度
side = "left", -- 显示在左侧
},
-- Git 状态集成(替代 nerdtree-git-plugin)
git = {
enable = true,
ignore = false,
timeout = 500,
},
-- 文件过滤(隐藏文件)
filters = {
dotfiles = false, -- 显示 . 开头的文件
},
-- 快捷键配置
on_attach = function(bufnr)
local api = require("nvim-tree.api")
-- 自定义快捷键
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
-- 常用操作
vim.keymap.set("n", "o", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "<CR>", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "s", api.node.open.vertical, opts("Open: Vertical Split"))
vim.keymap.set("n", "a", api.fs.create, opts("Create File/Dir"))
vim.keymap.set("n", "d", api.fs.remove, opts("Delete"))
end,
})
end,
},
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
local cmp = require("cmp")
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
opts.experimental = {
ghost_text = false,
}
opts.mapping = vim.tbl_extend("force", opts.mapping or {}, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
})
end,
},
{
"preservim/vim-markdown",
ft = "markdown",
init = function()
vim.g.vim_markdown_spellcheck = 0 -- 关闭拼写检查
vim.g.vim_markdown_conceal = 0 -- 关闭特殊符号隐藏
end,
},
{
"saghen/blink.cmp",
event = { "BufReadPost", "BufNewFile" },
version = "1.*",
-- build = 'cargo build --realease',
opts = {
completion = {
documentation = {
auto_show = true,
},
},
keymap = {
["<C-u>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" },
},
signature = {
enabled = true,
},
},
},
}
|
alpha.lua
(欢迎界面)
点击展开
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
return {
-- { "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
-- Dashboard. This runs when neovim starts, and is what displays
-- the "LAZYVIM" banner.
{
"goolord/alpha-nvim",
event = "VimEnter",
enabled = true,
init = false,
opts = function()
local dashboard = require("alpha.themes.dashboard")
-- local logo = [[
-- ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
-- ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
-- ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
-- ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
-- ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
-- ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
-- ]]
local logo = [[
███╗ ██╗ █████╗ ███╗ ██╗ ██████╗ ██╗███╗ ██╗
████╗ ██║██╔══██╗████╗ ██║██╔════╝ ██║████╗ ██║
██╔██╗ ██║███████║██╔██╗ ██║██║ ███╗██║██╔██╗ ██║
██║╚██╗██║██╔══██║██║╚██╗██║██║ ██║██║██║╚██╗██║
██║ ╚████║██║ ██║██║ ╚████║╚██████╔╝██║██║ ╚████║
╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝╚═╝ ╚═══╝
]]
dashboard.section.header.val = vim.split(logo, "\n")
-- stylua: ignore
dashboard.section.buttons.val = {
dashboard.button("f", " " .. " Find file", "<cmd> lua LazyVim.pick()() <cr>"),
dashboard.button("n", " " .. " New file", [[<cmd> ene <BAR> startinsert <cr>]]),
dashboard.button("r", " " .. " Recent files", [[<cmd> lua LazyVim.pick("oldfiles")() <cr>]]),
dashboard.button("g", " " .. " Find text", [[<cmd> lua LazyVim.pick("live_grep")() <cr>]]),
dashboard.button("c", " " .. " Config", "<cmd> lua LazyVim.pick.config_files()() <cr>"),
dashboard.button("s", " " .. " Restore Session", [[<cmd> lua require("persistence").load() <cr>]]),
dashboard.button("x", " " .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
dashboard.button("l", " " .. " Lazy", "<cmd> Lazy <cr>"),
dashboard.button("q", " " .. " Quit", "<cmd> qa <cr>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end,
config = function(_, dashboard)
vim.api.nvim_set_hl(0, "AlphaHeader", { fg = "#BD93F9", bold = true })
vim.api.nvim_set_hl(0, "AlphaButtons", { fg = "#50FA7B", bold = true })
vim.api.nvim_set_hl(0, "AlphaShortcut", { fg = "#05D9FF", italic = true })
vim.api.nvim_set_hl(0, "AlphaFooter", { fg = "#FF9D00", italic = true })
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
once = true,
pattern = "AlphaReady",
callback = function()
require("lazy").show()
end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
once = true,
pattern = "LazyVimStarted",
callback = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
-- dashboard.section.footer.val = "⚡ Neovim loaded "
-- Lain 主题 Footer
dashboard.section.footer.val = "あなたはそこにいますか? ⇝ Lain [neovim loaded] "
.. stats.loaded
.. "/"
.. stats.count
.. " plugins in "
.. ms
.. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
},
}
|
init.lua
主文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
-- bootstrap lazy.nvim, LazyVim
-- 获取当前文件名(不带扩展名)
local function get_filename()
return vim.fn.expand("%:r") -- %:r 去掉扩展名(如 main.cpp → main)
end
-- F5: 编译当前文件
vim.keymap.set("n", "<F5>", function()
local filetype = vim.bo.filetype
local filename = get_filename()
if filetype == "cpp" then
vim.cmd("!g++ -Wall -g % -o " .. filename)
elseif filetype == "c" then
vim.cmd("!gcc -Wall -g % -o " .. filename)
end
print("✅ 编译完成!可执行文件: ./" .. filename)
end, { noremap = true, silent = false })
-- 启用系统剪贴板
vim.opt.clipboard = "unnamedplus"
-- 映射 Ctrl+Shift+V 粘贴(插入模式)
vim.api.nvim_set_keymap("i", "<C-S-v>", "<C-r>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-S-v>", '"+p', { noremap = true, silent = true })
---
if vim.g.neovide then
vim.g.neovide_theme = "auto"
vim.g.neovide_cursor_vfx_mode = "torpedo"
vim.o.guifont = "JetBrainsMono Nerd Font:h10"
end
require("config.lazy")
vim.opt.spelllang = "en,cjk" -- 允许中英文混合
-- 禁用标点风格检查
vim.g.vim_markdown_strikethrough = 0 -- 如果使用 vim-markdown 插件
-- 补全
require("mini.pairs").setup({
mappings = {
['"'] = { action = "closeopen", pair = '""', neigh_pattern = '[^\\"].*[^\\]"' },
["'"] = { action = "closeopen", pair = "''", neigh_pattern = "[^\\'].*[^\\]'" },
},
})
-- themes --
vim.cmd([[colorscheme dracula]])
-- vim.cmd([[colorscheme catppuccin]])
-- vim.cmd([[colorscheme cyberdream]])
|
GDB使用
网站
配置(pwndbg+pwngdb+gef)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
source ~/pwndbg/gdbinit.py
source ~/Pwngdb/pwngdb.py
source ~/Pwngdb/angelheap/gdbinit.py
set resolve-heap-via-heuristic force #解决没debug文件不加载heap
set print symbol-filename on #这会让 GDB 在显示指针地址时,同时显示它所属的函数和偏移量(例如 `main+0x50`)。
#source ~/gef/gef.py
define hook-run
python
import angelheap
angelheap.init_angelheap()
end
end
|
使用GPT-SOVITS训练的AI LAIN语音模型
使用教程
模型:LAIN_CALM
提取码:LAIN
模型中有提供打标完成的文本和切割过的音频,可以直接按照视频中推理部分进行操作
git自动化hugo推送脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/bin/bash
# 设置博客生成目录和目标仓库路径
HUGO_PUBLIC_DIR="/d/blog/nan0in_blog/nan0in27/public"
REPO_DIR="/d/blog/nan0in_blog/nan0in27/nan0in27_site"
# 生成 Hugo 静态文件
cd /d/blog/nan0in_blog/nan0in27
hugo
# 复制 public 目录中的文件到 博客仓库
echo "Copying files from Hugo public directory to nan0in27_site..."
cp -r $HUGO_PUBLIC_DIR/* $REPO_DIR/
# 进入 博客仓库
cd $REPO_DIR
# 确保你在正确的 Git 仓库目录下
if [ -d ".git" ]; then
# 添加所有更改的文件到 Git
git add .
# 提交更改
git commit -m "Update site content"
# 推送到远程仓库
git push origin master
else
echo "Error: Not a Git repository. Please check your repository configuration."
exit 1
fi
|