Explorar el Código

增加了tmux的配置

seamew hace 3 años
padre
commit
81aa605761

+ 117 - 0
linux/tmux/tmux.md

@@ -0,0 +1,117 @@
+>[TOC]
+
+
+# 1、tmux简介
+
+tmux (opens new window)是linux中一种管理窗口的程序,它提供了一个Session随时存储和恢复的功能。
+
+# 2、软件安装
+
+```shell
+# Mac
+$ brew install tmux
+
+# Ubuntu 或 Debian
+$ sudo apt-get install tmux
+
+# CentOS 或 Fedor可以使用yum/dnf/brew等方式安装,brew版本更高些
+$ yum install tmux
+```
+
+# 3、软件的使用
+
+```shell
+# 加载配置文件
+tmux source-file ~/.tmux.conf
+
+# 新建会话
+tmux new -s hdcms
+# 查看会话
+ctrl+b s
+# 重命名会话
+Ctrl+b $
+
+# 创建窗口
+ctrl+b c
+# 切换到2号窗口
+ctrl+b 2
+# 重命名窗口
+ctrl+b , 
+# 关闭窗口
+ctrl+b &
+
+# 水平拆分出一个新窗格
+ctrl+b %
+# 垂直拆分窗格
+ctrl+b "
+# 切换到下一个窗格
+ctrl+b o
+# 关闭窗格
+ctrl+b x
+```
+
+# 4、保存回话
+
+```shell
+# 安装插件
+git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
+git clone https://github.com/tmux-plugins/tmux-resurrect ~/.tmux/plugins/resurrect
+
+# 修改配置文件 ~/.tmux.conf添加以下内容
+# 自动保存会话
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+set -g @plugin 'tmux-plugins/tmux-resurrect'
+set -g @plugin 'tmux-plugins/tmux-continuum'
+set -g @continuum-save-interval '15'
+set -g @continuum-restore 'on'
+set -g @resurrect-capture-pane-contents 'on'
+run '~/.tmux/plugins/tpm/tpm'
+
+run-shell ~/.tmux/plugins/resurrect/resurrect.tmux
+
+# 返回终端重新加载配置项
+tmux source ~/.tmux.conf
+
+# 然后执行命令安装插件,默认的prefix是crl+b
+prefix + I 
+
+# 保存会话
+prefix + Ctrl-s
+
+# 恢复会话
+prefix + Ctrl-r
+
+```
+
+# 5、常用快捷键
+
+## 5.1、窗格快捷键
+
+| **快捷键**        | **说明**                                   |
+| ----------------- | ------------------------------------------ |
+| Ctrl+b %          | 划分左右两个窗格                           |
+| Ctrl+b "          | 划分上下两个窗格                           |
+| Ctrl+b ;          | 切换到上一个窗格                           |
+| Ctrl+b o          | 光标切换到下一个窗格                       |
+| Ctrl+b {          | 当前窗格左移                               |
+| Ctrl+b }          | 当前窗格右移                               |
+| Ctrl+b Ctrl+o     | 当前窗格上移                               |
+| Ctrl+b Alt+o      | 当前窗格下移                               |
+| Ctrl+b x          | 关闭当前窗格                               |
+| Ctrl+b !          | 将当前窗格拆分为一个独立窗口               |
+| Ctrl+b z          | 当前窗格全屏显示,再使用一次会变回原来大小 |
+| Ctrl+b q          | 显示窗格编号                               |
+| Ctrl+b Alt+方向键 | 调整窗格大小                               |
+
+## 5.2、窗口管理
+
+| 快捷键   | 说明                                              |
+| -------- | ------------------------------------------------- |
+| Ctrl+b p | 切换到上一个窗口(按照状态栏上的顺序)            |
+| Ctrl+b n | 切换到下一个窗口                                  |
+| Ctrl+b   | 切换到指定编号的窗口,number 是状态栏上的窗口编号 |
+| Ctrl+b w | 从列表中选择窗口                                  |
+| ctrl+b & | 关闭当前窗口                                      |
+| ctrl+b x | 删除窗口                                          |
+

+ 23 - 0
linux/tmux/配置文件md

@@ -0,0 +1,23 @@
+````shell
+# .tmux.conf
+run-shell /home/seamew/software/tmux-onedark-theme/tmux-onedark-theme.tmux
+set -g @onedark_widgets " "
+set -g @onedark_time_format "%I:%M "
+set -g @onedark_date_format "%m/%d"
+set-option -g status-position bottom
+# 窗口序号从1开始计数
+set -g base-index 1
+
+# 自动保存会话
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+set -g @plugin 'tmux-plugins/tmux-resurrect'
+set -g @plugin 'tmux-plugins/tmux-continuum'
+set -g @continuum-save-interval '15'
+set -g @continuum-restore 'on'
+set -g @resurrect-capture-pane-contents 'on'
+run '~/.tmux/plugins/tpm/tpm'
+
+run-shell ~/.tmux/plugins/resurrect/resurrect.tmux
+````
+

+ 11 - 12
linux/zsh/zsh的配置文件.md

@@ -62,7 +62,17 @@ ZSH_THEME="ys"
  
 # z命令快速跳转目录     x命令解压一切文件         命令行可以直接google  
 plugins=(
-  git z zsh-autosuggestions extract zsh-syntax-highlighting mvn zsh-completions
+  git 
+  z 
+  zsh-autosuggestions 
+  extract 
+  zsh-syntax-highlighting 
+  mvn 
+  zsh-completions 
+  docker 
+  npm
+  node 
+  yarn
 )
  
 source $ZSH/oh-my-zsh.sh
@@ -95,16 +105,6 @@ source $ZSH/oh-my-zsh.sh
 # Example aliases
 # alias zshconfig="mate ~/.zshrc"
 # alias ohmyzsh="mate ~/.oh-my-zsh"
-# 环境变量
-# java
-export JAVA_HOME=/usr/local/java/jdk1.8.0_301
-export JRE_HOME=${JAVA_HOME}/jre
-export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
-export PATH=${JAVA_HOME}/bin:$PATH
-# maven
-MAVEN_HOME=/usr/local/maven/apache-maven-3.8.2
-export MAVEN_HOME
-export PATH=${PATH}:${MAVEN_HOME}/bin
 # 解决复制卡顿问题
 pasteinit() {
   OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
@@ -118,5 +118,4 @@ zstyle :bracketed-paste-magic paste-init pasteinit
 zstyle :bracketed-paste-magic paste-finish pastefinish 
 # 自动更新的时间间隔,单位是天,这里设置 30 天更新一次
 export UPDATE_ZSH_DAYS=1
-
 ```

+ 0 - 0
后端/JVM虚拟机/1.走进JAVA.md


+ 2 - 2
大数据/kafka/1.kafka笔记.md

@@ -109,7 +109,7 @@ ls /brokers/ids/
 
 * 通过kafka命令向zk中创建⼀个主题
 ```
-./kafka-topics.sh --create --zookeeper 192.168.245.21:2181 --replication-factor 1 --partitions 1 --topic test
+./kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 1 --topic test
 ```
 
 * 查看当前zk中所有的主题
@@ -166,7 +166,7 @@ kafka⾃带了⼀个producer命令客户端,可以从本地⽂件中读取内
 
 不同的消费组订阅同⼀个topic,那么不同的消费组中只有⼀个消费者能收到消息。实际上也是多个消费组中的多个消费者收到了同⼀个消息。
 ```
-./kafka-console-consumer.sh --bootstrap-server 192.168.245.21:9092 --consumer-property group.id=testGroup1 --topic test
+./kafka-console-consumer.sh --bootstrap-server 127.0.0.1:2181 --consumer-property group.id=testGroup1 --topic test
 
 ./kafka-console-consumer.sh --bootstrap-server 192.168.245.21:9092 --consumer-property group.id=testGroup2 --topic test
 ```