Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e430d2a721 | |||
| a48619031d | |||
| 7ef3a2f073 | |||
| ddda0a2a02 | |||
| 685b477e1b | |||
| dc01c402c8 | |||
| b1698fb7cf | |||
| fad2c5fed9 | |||
| 23c83906b5 | |||
| 820d501911 | |||
| 0b7374d42a | |||
| b49026c12e | |||
| 3fad1b11f4 | |||
| b63fb4494c | |||
| a103031734 | |||
| f12a4caccb | |||
| fa8b291b1d | |||
| 47f16510b2 | |||
| d2aa7bad86 | |||
| 9b9a929281 | |||
| e10a850527 | |||
| 7d83cc0d6e | |||
| d42ae1bb29 | |||
| 96f4181e5f | |||
| 53ab00c196 | |||
| 1def7fc888 | |||
| c20d5f6024 | |||
| 6c36082c4f | |||
| 2072b48df7 | |||
| 83dbf07703 | |||
| 1fd0cdaf63 | |||
| 06cf9bae2c | |||
| 77d16ce217 | |||
| 8bc810fd39 | |||
| 3180d287e7 | |||
| 46a920d574 |
@@ -2,3 +2,7 @@
|
|||||||
.SpaceVim.d/init.vim
|
.SpaceVim.d/init.vim
|
||||||
.DS_Store
|
.DS_Store
|
||||||
nvim/plugin
|
nvim/plugin
|
||||||
|
_set_env_*.sh
|
||||||
|
_set_env.sh
|
||||||
|
log
|
||||||
|
cn.sh
|
||||||
|
|||||||
+44
-87
@@ -4,21 +4,47 @@ run:
|
|||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- govet
|
- govet
|
||||||
|
- errcheck
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- unused
|
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- typecheck
|
- typecheck
|
||||||
- exportloopref
|
- exportloopref
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- gofmt
|
- gofmt
|
||||||
|
- misspell
|
||||||
|
- gosimple
|
||||||
- stylecheck
|
- stylecheck
|
||||||
- revive
|
- revive
|
||||||
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
|
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
|
||||||
disable-all: true
|
disable-all: true
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
errcheck:
|
||||||
|
exclude-functions:
|
||||||
|
- io/ioutil.ReadFile
|
||||||
|
- io.Copy(*bytes.Buffer)
|
||||||
|
- io.Copy(os.Stdout)
|
||||||
|
- net.(*)
|
||||||
staticcheck:
|
staticcheck:
|
||||||
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||||
checks: ["all"]
|
checks: ["all"]
|
||||||
|
stylecheck:
|
||||||
|
checks:
|
||||||
|
[
|
||||||
|
"all",
|
||||||
|
"-ST1000",
|
||||||
|
"-ST1001",
|
||||||
|
"-ST1003",
|
||||||
|
"-ST1016",
|
||||||
|
"-ST1020",
|
||||||
|
"-ST1021",
|
||||||
|
"-ST1022",
|
||||||
|
]
|
||||||
|
misspell:
|
||||||
|
# Correct spellings using locale preferences for US or UK.
|
||||||
|
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
|
||||||
|
# Default is to use a neutral variety of English.
|
||||||
|
locale: US
|
||||||
|
ignore-words: []
|
||||||
revive:
|
revive:
|
||||||
# Maximum number of open files at the same time.
|
# Maximum number of open files at the same time.
|
||||||
# See https://github.com/mgechev/revive#command-line-flags
|
# See https://github.com/mgechev/revive#command-line-flags
|
||||||
@@ -34,26 +60,17 @@ linters:
|
|||||||
severity: error
|
severity: error
|
||||||
# Enable all available rules.
|
# Enable all available rules.
|
||||||
# Default: false
|
# Default: false
|
||||||
enable-all-rules: true
|
enable-all-rules: false
|
||||||
# Sets the default failure confidence.
|
# Sets the default failure confidence.
|
||||||
# This means that linting errors with less than 0.8 confidence will be ignored.
|
# This means that linting errors with less than 0.8 confidence will be ignored.
|
||||||
# Default: 0.8
|
# Default: 0.8
|
||||||
confidence: 0.1
|
confidence: 0.1
|
||||||
rules:
|
rules:
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant
|
|
||||||
- name: add-constant
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
arguments:
|
|
||||||
- maxLitCount: "3"
|
|
||||||
allowStrs: '""'
|
|
||||||
allowInts: "0,1,2"
|
|
||||||
allowFloats: "0.0,0.,1.0,1.,2.0,2."
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#argument-limit
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#argument-limit
|
||||||
- name: argument-limit
|
- name: argument-limit
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments: [4]
|
arguments: [6]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
|
||||||
- name: atomic
|
- name: atomic
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -62,15 +79,7 @@ linters:
|
|||||||
- name: banned-characters
|
- name: banned-characters
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments: ["Ω", "Σ", "σ", "7"]
|
arguments: ["Ω", "Σ", "σ"]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return
|
|
||||||
- name: bare-return
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports
|
|
||||||
- name: blank-imports
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
|
||||||
- name: bool-literal-in-expr
|
- name: bool-literal-in-expr
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -83,15 +92,7 @@ linters:
|
|||||||
- name: cognitive-complexity
|
- name: cognitive-complexity
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments: [7]
|
arguments: [14]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming
|
|
||||||
- name: confusing-naming
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-results
|
|
||||||
- name: confusing-results
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr
|
||||||
- name: constant-logical-expr
|
- name: constant-logical-expr
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -108,7 +109,7 @@ linters:
|
|||||||
- name: cyclomatic
|
- name: cyclomatic
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments: [3]
|
arguments: [10]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
|
||||||
- name: datarace
|
- name: datarace
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -123,10 +124,6 @@ linters:
|
|||||||
disabled: false
|
disabled: false
|
||||||
arguments:
|
arguments:
|
||||||
- ["call-chain", "loop"]
|
- ["call-chain", "loop"]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
|
|
||||||
- name: dot-imports
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
|
||||||
- name: duplicated-imports
|
- name: duplicated-imports
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -135,14 +132,6 @@ linters:
|
|||||||
- name: early-return
|
- name: early-return
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block
|
|
||||||
- name: empty-block
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
|
|
||||||
- name: empty-lines
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming
|
||||||
- name: error-naming
|
- name: error-naming
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -166,26 +155,16 @@ linters:
|
|||||||
arguments:
|
arguments:
|
||||||
- "checkPrivateReceivers"
|
- "checkPrivateReceivers"
|
||||||
- "sayRepetitiveInsteadOfStutters"
|
- "sayRepetitiveInsteadOfStutters"
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header
|
|
||||||
- name: file-header
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
arguments:
|
|
||||||
- This is the text that must appear at the top of source files.
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
|
|
||||||
- name: flag-parameter
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
|
||||||
- name: function-result-limit
|
- name: function-result-limit
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments: [2]
|
arguments: [4]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length
|
||||||
- name: function-length
|
- name: function-length
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments: [10, 0]
|
arguments: [100, 0]
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
|
||||||
- name: get-return
|
- name: get-return
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -213,24 +192,6 @@ linters:
|
|||||||
arguments:
|
arguments:
|
||||||
- "crypto/md5"
|
- "crypto/md5"
|
||||||
- "crypto/sha1"
|
- "crypto/sha1"
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
|
|
||||||
- name: import-shadowing
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit
|
|
||||||
- name: line-length-limit
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
arguments: [80]
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs
|
|
||||||
- name: max-public-structs
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
arguments: [3]
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter
|
|
||||||
- name: modifies-parameter
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-value-receiver
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-value-receiver
|
||||||
- name: modifies-value-receiver
|
- name: modifies-value-receiver
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -276,10 +237,10 @@ linters:
|
|||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
arguments:
|
arguments:
|
||||||
- - 'core.WriteError[1].Message'
|
- - "core.WriteError[1].Message"
|
||||||
- '/^([^A-Z]|$)/'
|
- "/^([^A-Z]|$)/"
|
||||||
- must not start with a capital letter
|
- must not start with a capital letter
|
||||||
- - 'fmt.Errorf[0]'
|
- - "fmt.Errorf[0]"
|
||||||
- '/(^|[^\.!?])$/'
|
- '/(^|[^\.!?])$/'
|
||||||
- must not end in punctuation
|
- must not end in punctuation
|
||||||
- - panic
|
- - panic
|
||||||
@@ -304,7 +265,7 @@ linters:
|
|||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
|
||||||
- name: var-naming
|
- name: var-naming
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: true
|
||||||
arguments:
|
arguments:
|
||||||
- ["ID"] # AllowList
|
- ["ID"] # AllowList
|
||||||
- ["VM"] # DenyList
|
- ["VM"] # DenyList
|
||||||
@@ -326,10 +287,14 @@ linters:
|
|||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
|
||||||
- name: unhandled-error
|
- name: unhandled-error
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: true
|
||||||
|
# bytes.Buffer.Write: package name, structure name, function name
|
||||||
arguments:
|
arguments:
|
||||||
- "fmt.Printf"
|
- "fmt.Printf"
|
||||||
- "myFunction"
|
- "os.(Create|WriteFile|Chmod)"
|
||||||
|
- "net.*"
|
||||||
|
- "bytes.Buffer.WriteString"
|
||||||
|
- "con.WriteString"
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt
|
||||||
- name: unnecessary-stmt
|
- name: unnecessary-stmt
|
||||||
severity: warning
|
severity: warning
|
||||||
@@ -338,14 +303,6 @@ linters:
|
|||||||
- name: unreachable-code
|
- name: unreachable-code
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
|
|
||||||
- name: unused-parameter
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
|
|
||||||
- name: unused-receiver
|
|
||||||
severity: warning
|
|
||||||
disabled: false
|
|
||||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
|
||||||
- name: useless-break
|
- name: useless-break
|
||||||
severity: warning
|
severity: warning
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ bind -r L resizep -R 10 # 绑定Ctrl+l为往→调整面板边缘10个单元格
|
|||||||
# 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候
|
# 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候
|
||||||
set -s escape-time 1
|
set -s escape-time 1
|
||||||
|
|
||||||
|
# 返回上一个窗口
|
||||||
|
bind g last-window
|
||||||
|
|
||||||
# 设置窗口名为当前目录名
|
# 设置窗口名为当前目录名
|
||||||
set-option -g status-interval 10
|
set-option -g status-interval 10
|
||||||
set-option -g automatic-rename on
|
set-option -g automatic-rename on
|
||||||
|
|||||||
@@ -109,23 +109,26 @@ unsetopt BEEP
|
|||||||
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
|
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
|
||||||
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
|
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
|
||||||
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
|
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
|
||||||
export HOMEBREW_NO_AUTO_UPDATE=true # 禁止 brew 每次安装软件都 upate
|
|
||||||
|
|
||||||
# git
|
# git
|
||||||
export REVIEW_BASE="master"
|
export REVIEW_BASE="master"
|
||||||
|
|
||||||
# go
|
# go
|
||||||
export GOPATH=$HOME/go
|
export GOPATH=$HOME/go:$HOME/workrepo/go
|
||||||
export PATH=$PATH:$GOPATH/bin
|
export PATH=$PATH:$HOME/go/bin
|
||||||
export GOPROXY=goproxy.cn
|
export GOPROXY=goproxy.cn
|
||||||
export GOSUMDB="sum.golang.google.cn"
|
export GOSUMDB="sum.golang.google.cn"
|
||||||
|
|
||||||
|
|
||||||
[ -f ~/.zprofile ] && source ~/.zprofile
|
[ -f ~/.zprofile ] && source ~/.zprofile
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||||
|
test -e /home/linuxbrew/.linuxbrew/ && export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin
|
||||||
|
test -e ~/.pri_scripts && export PATH=$PATH:~/.pri_scripts
|
||||||
|
|
||||||
# add z
|
# add z
|
||||||
|
if command -v lua >/dev/null; then
|
||||||
eval "$(lua /usr/local/z.lua/z.lua --init zsh)"
|
eval "$(lua /usr/local/z.lua/z.lua --init zsh)"
|
||||||
|
fi
|
||||||
|
|
||||||
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
||||||
export PATH="/usr/local/sbin:$PATH"
|
export PATH="/usr/local/sbin:$PATH"
|
||||||
@@ -138,9 +141,13 @@ alias alert='terminal-notifier -title "Terminal" -message "Done with task! Exit
|
|||||||
|
|
||||||
# git
|
# git
|
||||||
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
|
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
|
||||||
alias ct="go test -gcflags=all=-l -cover ./..."
|
alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..."
|
||||||
alias ci="golangci-lint -c=~/.dotfile/.golangci.yml run ./..."
|
|
||||||
alias gmt="go mod tidy"
|
alias gmt="go mod tidy"
|
||||||
alias gt="go test -gcflags=all=-l "
|
alias gtc="go test -gcflags=all=-l -cover ./..."
|
||||||
alias swg="swag init -o docs -g "
|
alias swg="swag init -o docs -g "
|
||||||
alias sws="swagger serve -F=swagger"
|
alias sws="swagger serve -F=swagger"
|
||||||
|
|
||||||
|
function gtr(){
|
||||||
|
go test -gcflags=all=-l -v -run="$1"
|
||||||
|
}
|
||||||
|
fpath+=${ZDOTDIR:-~}/.zsh_functions
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
### 使用
|
### 使用
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/Laily123/.dotfile.git ~/.dotfile
|
git clone https://github.com/Laily123/.dotfile.git ~/.dotfile
|
||||||
```
|
```
|
||||||
|
|
||||||
### zsh 安装
|
### zsh 安装
|
||||||
|
|
||||||
安装 zsh
|
安装 zsh
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
|
https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
|
||||||
# macOS
|
# macOS
|
||||||
@@ -15,10 +19,13 @@ apt install zsh
|
|||||||
```
|
```
|
||||||
|
|
||||||
安装 oh-my-zsh
|
安装 oh-my-zsh
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
||||||
```
|
```
|
||||||
|
|
||||||
初始化配置
|
初始化配置
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ln -sf ~/.dotfile/.zshrc ~/
|
ln -sf ~/.dotfile/.zshrc ~/
|
||||||
ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/
|
ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/
|
||||||
@@ -27,9 +34,10 @@ ln -sf ~/.dotfile/.gitconfig ~/.gitconfig
|
|||||||
```
|
```
|
||||||
|
|
||||||
### spacevim 安装
|
### spacevim 安装
|
||||||
|
|
||||||
安装
|
安装
|
||||||
`curl -sLf https://spacevim.org/install.sh | bash`
|
`curl -sLf https://spacevim.org/install.sh | bash`
|
||||||
初始化配置
|
初始化配置
|
||||||
`ln -sf ~/.dotfile/.SpaceVim.d ~/`
|
`ln -sf ~/.dotfile/.SpaceVim.d ~/`
|
||||||
|
|
||||||
|
#
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
## set environment
|
||||||
|
|
||||||
|
# brew
|
||||||
|
set -gx HOMEBREW_BREW_GIT_REMOTE "https://mirrors.ustc.edu.cn/brew.git"
|
||||||
|
set -gx HOMEBREW_CORE_GIT_REMOTE "https://mirrors.ustc.edu.cn/homebrew-core.git"
|
||||||
|
set -gx HOMEBREW_BOTTLE_DOMAIN "https://mirrors.ustc.edu.cn/homebrew-bottles"
|
||||||
|
|
||||||
|
# go
|
||||||
|
set -gx GOPATH $HOME/go:$HOME/workrepo/go
|
||||||
|
set -gx GOPROXY "goproxy.cn,direct"
|
||||||
|
set -gx GOSUMDB "sum.golang.google.cn"
|
||||||
|
|
||||||
|
set -gx PATH $PATH $HOME/go/bin
|
||||||
|
set -gx PATH $PATH $HOME/.yarn/bin $HOME/.config/yarn/global/node_modules/.bin
|
||||||
|
set -gx PATH $PATH /usr/local/sbin
|
||||||
|
# add nvim
|
||||||
|
set -gx PATH $PATH /usr/local/nvim/bin /usr/local/osx-64/nvim/bin
|
||||||
|
set -gx EDITOR vim
|
||||||
|
|
||||||
|
# alias
|
||||||
|
# git
|
||||||
|
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
|
||||||
|
alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..."
|
||||||
|
alias gmt="go mod tidy"
|
||||||
|
alias gtc="go test -gcflags=all=-l -cover ./..."
|
||||||
|
alias swg="swag init -o docs -g "
|
||||||
|
alias sws="swagger serve -F=swagger"
|
||||||
|
|
||||||
|
function gtr
|
||||||
|
go test -gcflags=all=-l -v -run="$1"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if status is-interactive
|
||||||
|
# Commands to run in interactive sessions can go here
|
||||||
|
end
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
if [ -f "$HOME/.config/fish/config.fish" ]; then
|
||||||
|
mv $HOME/.config/fish/config.fish $HOME/.config/fish/config.fish.bak
|
||||||
|
fi
|
||||||
|
ln -s $HOME/.dotfile/fish/config.fish $HOME/.config/fish/config.fish
|
||||||
+25
-6
@@ -4,23 +4,40 @@
|
|||||||
[core]
|
[core]
|
||||||
autocrlf = input
|
autocrlf = input
|
||||||
quotepath = false
|
quotepath = false
|
||||||
editor = /usr/local/bin/nvim
|
editor = nvim
|
||||||
excludesfile = ~/.dotfile/git/.gitignore
|
excludesfile = ~/.dotfile/git/.gitignore
|
||||||
[push]
|
[push]
|
||||||
default = current
|
default = current
|
||||||
|
[pull]
|
||||||
|
rebase = false
|
||||||
|
[color]
|
||||||
|
status = auto
|
||||||
|
diff = auto
|
||||||
|
branch = auto
|
||||||
|
interactive = auto
|
||||||
|
grep = auto
|
||||||
|
ui = auto
|
||||||
[merge]
|
[merge]
|
||||||
tool = vimdiff
|
tool = nvimdiff
|
||||||
[include]
|
[difftool "nvimdiff"]
|
||||||
path = ~/.subgitconfig
|
cmd = nvim -d \"$LOCAL\" \"$REMOTE\"
|
||||||
|
[mergetool "nvimdiff"]
|
||||||
|
cmd = nvim -d \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
|
||||||
|
trustExitCode = true
|
||||||
|
[includeIf "gitdir:~/workrepo/"]
|
||||||
|
path = ~/.workgitconfig
|
||||||
[branch]
|
[branch]
|
||||||
autoSetupMerge = always
|
autoSetupMerge = always
|
||||||
[alias]
|
[alias]
|
||||||
au = add -u
|
au = add -u
|
||||||
co = checkout
|
co = checkout
|
||||||
cm = commit -m
|
cm = "!f() { if [[ -z \"$1\" ]]; then git commit; else git commit -m \"$*\"; fi; }; f"
|
||||||
st = status
|
st = status
|
||||||
ap = add -p
|
ap = add -p
|
||||||
br = branch
|
br = branch
|
||||||
|
ba = branch -a
|
||||||
|
bm = branch --merged
|
||||||
|
bn = branch --no-merged
|
||||||
pl = pull
|
pl = pull
|
||||||
pt = push origin --tags
|
pt = push origin --tags
|
||||||
merge2 = !sh -c '_CURRENT_BRANCH=$(git symbolic-ref --short HEAD) && git checkout $1 && git merge $_CURRENT_BRANCH && git checkout $_CURRENT_BRANCH' -
|
merge2 = !sh -c '_CURRENT_BRANCH=$(git symbolic-ref --short HEAD) && git checkout $1 && git merge $_CURRENT_BRANCH && git checkout $_CURRENT_BRANCH' -
|
||||||
@@ -44,4 +61,6 @@
|
|||||||
# instead of opening all files:
|
# instead of opening all files:
|
||||||
# git reviewone foo.js bar.js
|
# git reviewone foo.js bar.js
|
||||||
reviewone = !vim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
|
reviewone = !vim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
|
||||||
|
#git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Laily'; GIT_AUTHOR_EMAIL='i@laily.net'; GIT_COMMITTER_NAME='Laily'; GIT_COMMITTER_EMAIL='i@laily.net';" HEAD
|
||||||
|
[protocol "file"]
|
||||||
|
allow = always
|
||||||
|
|||||||
@@ -26,7 +26,12 @@ _testmain.go
|
|||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.SpaceVim.d/.netrwhist
|
||||||
|
.SpaceVim.d/init.vim
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.log
|
.log
|
||||||
go.work
|
go.work
|
||||||
go.work.sum
|
go.work.sum
|
||||||
|
init_test.go
|
||||||
|
_set_env.sh
|
||||||
|
_set_env_*.sh
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
# Nvim config
|
|
||||||
|
|
||||||
## Backup plugin version
|
|
||||||
|
|
||||||
Because nvim have some breaking changes sometimes. I can not alwaexys use the latest version of plugins.
|
|
||||||
|
|
||||||
### Backup
|
|
||||||
|
|
||||||
Execute `get_packer_snapshot.sh`. This script will backup all the plugin commit information to a json file.
|
|
||||||
|
|
||||||
### Restore
|
|
||||||
|
|
||||||
document: https://github.com/wbthomason/packer.nvim#usage
|
|
||||||
|
|
||||||
```
|
|
||||||
vim +"PackerSnapshot lock-${version}.json"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
setl ts=2 sw=2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require('lang.go')
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
setl ts=2 sw=2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
setl ts=2 sw=2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
setl commentstring={/*%s*/} ts=2 sw=2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require('lang.js-ts')
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
vim.cmd('set ts=2') -- Insert 2 spaces for a tab
|
|
||||||
vim.cmd('set sw=2') -- Change the number of space characters inserted for indentation
|
|
||||||
require('lang/lua')
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
require('lang.bash')
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require('lang.js-ts')
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
vim.cmd('set ts=2') -- Insert 2 spaces for a tab
|
|
||||||
vim.cmd('set sw=2') -- Change the number of space characters inserted for indentation
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
vim.cmd('set ts=2') -- Insert 2 spaces for a tab
|
|
||||||
vim.cmd('set sw=2') -- Change the number of space characters inserted for indentation
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
setl ts=2 sw=2 ts=2 ai et
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
version=$(vim -v | awk 'NR==1{print $2}')
|
|
||||||
|
|
||||||
path="$HOME/.cache/nvim/packer.nvim/lock-${version}.json"
|
|
||||||
rm -rf ${path}
|
|
||||||
|
|
||||||
vim +"PackerSnapshot lock-${version}.json"
|
|
||||||
cp -f ${path} .
|
|
||||||
|
|
||||||
echo 'file at '${path}
|
|
||||||
+28
-28
@@ -1,33 +1,33 @@
|
|||||||
CONFIG_PATH = vim.fn.stdpath('config')
|
if vim.loader then
|
||||||
DATA_PATH = vim.fn.stdpath('data')
|
vim.loader.enable()
|
||||||
CACHE_PATH = vim.fn.stdpath('cache')
|
end
|
||||||
P = vim.inspect
|
|
||||||
|
|
||||||
require('lv-globals')
|
_G.dd = function(...)
|
||||||
vim.cmd('luafile '..CONFIG_PATH..'/settings.lua')
|
require("utils.debug").dump(...)
|
||||||
require('settings')
|
end
|
||||||
require('plugins')
|
vim.print = _G.dd
|
||||||
require('utils')
|
|
||||||
require('pluginconfig')
|
|
||||||
require('autocommands')
|
|
||||||
require('keymappings')
|
|
||||||
require('colorscheme') -- This plugin must be required somewhere after nvimtree. Placing it before will break navigation keymappings
|
|
||||||
|
|
||||||
-- TODO is there a way to do this without vimscript
|
require("config.lazy")
|
||||||
vim.cmd('source '..CONFIG_PATH..'/vimscript/functions.vim')
|
|
||||||
|
|
||||||
-- LSP
|
|
||||||
require('lsp')
|
|
||||||
|
|
||||||
--[[
|
-- CONFIG_PATH = vim.fn.stdpath('config')
|
||||||
require('lsp.css-ls')
|
-- DATA_PATH = vim.fn.stdpath('data')
|
||||||
require('lsp.docker-ls')
|
-- CACHE_PATH = vim.fn.stdpath('cache')
|
||||||
require('lsp.emmet-ls')
|
-- P = vim.inspect
|
||||||
require('lsp.html-ls')
|
|
||||||
require('lsp.json-ls')
|
-- require('lv-globals')
|
||||||
require('lsp.latex-ls')
|
-- vim.cmd('luafile '..CONFIG_PATH..'/settings.lua')
|
||||||
require('lsp.python-ls')
|
-- require('settings')
|
||||||
require('lsp.rust-ls')
|
-- require('plugins')
|
||||||
require('lsp.yaml-ls')
|
-- require('utils')
|
||||||
]]
|
-- require('pluginconfig')
|
||||||
|
-- require('autocommands')
|
||||||
|
-- require('keymappings')
|
||||||
|
-- require('colorscheme') -- This plugin must be required somewhere after nvimtree. Placing it before will break navigation keymappings
|
||||||
|
|
||||||
|
-- -- TODO is there a way to do this without vimscript
|
||||||
|
-- vim.cmd('source '..CONFIG_PATH..'/vimscript/functions.vim')
|
||||||
|
|
||||||
|
-- -- LSP
|
||||||
|
-- require('lsp')
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||||
|
"LazyVim": { "branch": "main", "commit": "fe72424e77cb9c953084bbcaaa0eb7fe8056dc70" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" },
|
||||||
|
"SchemaStore.nvim": { "branch": "main", "commit": "9bc9a3a19dc6047d79d6073082f3b0deb7002c99" },
|
||||||
|
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
|
||||||
|
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
|
||||||
|
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
|
||||||
|
"lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" },
|
||||||
|
"lspsaga.nvim": { "branch": "main", "commit": "b1b140aa20a0cf353cd3e282870429b48b30a169" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
|
||||||
|
"mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" },
|
||||||
|
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
|
||||||
|
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
|
||||||
|
"mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" },
|
||||||
|
"mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" },
|
||||||
|
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" },
|
||||||
|
"neoconf.nvim": { "branch": "main", "commit": "98980b5300e7a5e7f93e8dbf81c98cc3daa55df7" },
|
||||||
|
"neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
|
||||||
|
"neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" },
|
||||||
|
"neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" },
|
||||||
|
"neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
|
||||||
|
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||||
|
"nvim-lint": { "branch": "master", "commit": "4dade85ff26e4bad40f895a6cc6762b7036237f4" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" },
|
||||||
|
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
|
||||||
|
"nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "4a8901b0d5398b45e075fcdbf9b8fe546349cc14" },
|
||||||
|
"nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" },
|
||||||
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
|
||||||
|
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||||
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
|
||||||
|
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
|
||||||
|
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
|
||||||
|
"telescope-file-browser.nvim": { "branch": "master", "commit": "48ffb8de688a22942940f50411d5928631368848" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "d5c4d9856320a07d04607c9b3a0523bd3f373328" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
|
||||||
|
"vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" },
|
||||||
|
"vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" },
|
||||||
|
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
|
||||||
|
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extras": [
|
||||||
|
"lazyvim.plugins.extras.lang.go",
|
||||||
|
"lazyvim.plugins.extras.test.core"
|
||||||
|
],
|
||||||
|
"news": {
|
||||||
|
"NEWS.md": "2123"
|
||||||
|
},
|
||||||
|
"version": 2
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"nvim-dap": {"commit": "2cfd770"}, "FixCursorHold.nvim": {"commit": "5aa5ff1"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "65c0ee3"}, "codi.vim": {"commit": "2898369"}, "packer.nvim": {"commit": "6afb674"}, "nvim-lspconfig": {"commit": "51775b1"}, "playground": {"commit": "bcfab84"}, "numb.nvim": {"commit": "453c50a"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "which-key.nvim": {"commit": "92d924d"}, "telescope-file-browser.nvim": {"commit": "60bcf4e"}, "aerial.nvim": {"commit": "f7d6ca8"}, "nvim-autopairs": {"commit": "14cc2a4"}, "neotest-go": {"commit": "d506f83"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "nvim-comment": {"commit": "e9ac16a"}, "tabular": {"commit": "339091a"}, "rnvimr": {"commit": "4ced809"}, "gitsigns.nvim": {"commit": "4d8a6e0"}, "glow.nvim": {"commit": "8dca358"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "telescope.nvim": {"commit": "30e2dc5"}, "nvim-compe": {"commit": "d186d73"}, "telescope-project.nvim": {"commit": "91e9a97"}, "trouble.nvim": {"commit": "929315e"}, "nvim-ts-context-commentstring": {"commit": "4d3a68c"}, "lsp_signature.nvim": {"commit": "e65a638"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "c632f62"}, "hop.nvim": {"commit": "75f73d3"}, "lush.nvim": {"commit": "fabf012"}, "LuaSnip": {"commit": "e687d78"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "vim-matchup": {"commit": "ab8575d"}, "popup.nvim": {"commit": "b7404d3"}, "nvim-bqf": {"commit": "aac1ff9"}, "FTerm.nvim": {"commit": "efd1065"}, "lua-dev.nvim": {"commit": "315ad43"}, "nvim-treesitter": {"commit": "8689f61"}, "neotest": {"commit": "15c0bb2"}, "nvim-dap-ui": {"commit": "ebebd42"}, "nvim-luapad": {"commit": "9815e26"}, "monokai.nvim": {"commit": "4fc970e"}, "lspsaga.nvim": {"commit": "9ec569a"}, "vim-markdown": {"commit": "8a0b434"}, "dashboard-nvim": {"commit": "d82ddae"}, "barbar.nvim": {"commit": "c41ad6e"}, "nvim-tree.lua": {"commit": "fb8735e"}, "bracey.vim": {"commit": "4e1a22a"}, "fzf-lua": {"commit": "9b23c2c"}, "nvim-lsp-installer": {"commit": "ae913cb"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "toggleterm.nvim": {"commit": "f494c61"}, "plenary.nvim": {"commit": "62dc2a7"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "markdown-preview.nvim": {"commit": "02cc387"}, "nvim-web-devicons": {"commit": "2d02a56"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "galaxyline.nvim": {"commit": "eb81be0"}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"nvim-dap": {"commit": "8f396b7"}, "FixCursorHold.nvim": {"commit": "70a9516"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "7447fe7"}, "codi.vim": {"commit": "2898369"}, "packer.nvim": {"commit": "dcd2f38"}, "nvim-lspconfig": {"commit": "cb64ead"}, "playground": {"commit": "1290fdf"}, "numb.nvim": {"commit": "d95b7ea"}, "nvim-treesitter": {"commit": "7685324"}, "which-key.nvim": {"commit": "61553ae"}, "telescope-file-browser.nvim": {"commit": "8646e46"}, "fzf-lua": {"commit": "0c8b338"}, "nvim-autopairs": {"commit": "99f6963"}, "friendly-snippets": {"commit": "b4f857a"}, "vim-vsnip": {"commit": "e44026b"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "toggleterm.nvim": {"commit": "f494c61"}, "tabular": {"commit": "339091a"}, "cmp-nvim-lsp": {"commit": "5922477"}, "vim-fugitive": {"commit": "49cc585"}, "neotest": {"commit": "a2559f0"}, "gitsigns.nvim": {"commit": "d076301"}, "glow.nvim": {"commit": "20d1cd0"}, "lspkind-nvim": {"commit": "c68b3a0"}, "cmp-cmdline": {"commit": "23c51b2"}, "telescope.nvim": {"commit": "3c2e5fb"}, "telescope-project.nvim": {"commit": "ff4d3ce"}, "trouble.nvim": {"commit": "897542f"}, "nvim-ts-context-commentstring": {"commit": "32d9627"}, "lsp_signature.nvim": {"commit": "2f3e574"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "02a9182"}, "nvim-bqf": {"commit": "448fa92"}, "aerial.nvim": {"commit": "38c6fe1"}, "hop.nvim": {"commit": "75f73d3"}, "lush.nvim": {"commit": "979f4d2"}, "LuaSnip": {"commit": "e687d78"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "vim-matchup": {"commit": "55e3330"}, "popup.nvim": {"commit": "b7404d3"}, "cmp-vsnip": {"commit": "989a8a7"}, "nvim-web-devicons": {"commit": "189ad37"}, "FTerm.nvim": {"commit": "d132089"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "neotest-go": {"commit": "4573733"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "rnvimr": {"commit": "d78ca64"}, "nvim-dap-ui": {"commit": "54365d2"}, "barbar.nvim": {"commit": "9347ed8"}, "monokai.nvim": {"commit": "6fb4f7f"}, "lspsaga.nvim": {"commit": "9ec569a"}, "vim-markdown": {"commit": "df4be86"}, "dashboard-nvim": {"commit": "d82ddae"}, "nvim-luapad": {"commit": "6efe380"}, "nvim-tree.lua": {"commit": "829e9f6"}, "bracey.vim": {"commit": "4e1a22a"}, "nvim-lsp-installer": {"commit": "17e0bfa"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "nvim-comment": {"commit": "e9ac16a"}, "plenary.nvim": {"commit": "4b7e520"}, "nvim-cmp": {"commit": "93f385c"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "galaxyline.nvim": {"commit": "eb81be0"}, "markdown-preview.nvim": {"commit": "02cc387"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "neodev.nvim": {"commit": "dbed203"}, "cmp-path": {"commit": "91ff86c"}, "cmp-buffer": {"commit": "3022dbc"}}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
local utils = require('utils')
|
|
||||||
|
|
||||||
local auto_formatters = { }
|
|
||||||
|
|
||||||
local python_autoformat = {'BufWritePre', '*.py', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
if O.python.autoformat then table.insert(auto_formatters, python_autoformat) end
|
|
||||||
|
|
||||||
local javascript_autoformat = {'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
local javascriptreact_autoformat = {'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
local typescript_autoformat = {'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
local typescriptreact_autoformat = {'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
if O.tsserver.autoformat then
|
|
||||||
table.insert(auto_formatters, javascript_autoformat)
|
|
||||||
table.insert(auto_formatters, javascriptreact_autoformat)
|
|
||||||
table.insert(auto_formatters, typescript_autoformat)
|
|
||||||
table.insert(auto_formatters, typescriptreact_autoformat)
|
|
||||||
end
|
|
||||||
|
|
||||||
local lua_format = {'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
if O.lua.autoformat then table.insert(auto_formatters, lua_format) end
|
|
||||||
|
|
||||||
local json_format = {'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
|
||||||
if O.json.autoformat then table.insert(auto_formatters, json_format) end
|
|
||||||
|
|
||||||
local ruby_format = {'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
|
|
||||||
if O.ruby.autoformat then table.insert(auto_formatters, ruby_format) end
|
|
||||||
|
|
||||||
local go_format = {'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
|
|
||||||
if O.go.autoformat then table.insert(auto_formatters, go_format) end
|
|
||||||
|
|
||||||
utils.define_augroups({
|
|
||||||
_general_settings = {
|
|
||||||
{'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'},
|
|
||||||
{'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
|
|
||||||
{'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
|
|
||||||
{'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
|
|
||||||
{'VimLeavePre', '*', 'set title set titleold='},
|
|
||||||
{'FileType', 'qf', 'set nobuflisted'},
|
|
||||||
|
|
||||||
-- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'},
|
|
||||||
-- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
|
|
||||||
},
|
|
||||||
_java = {
|
|
||||||
{'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
|
|
||||||
{'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'}
|
|
||||||
},
|
|
||||||
_go = {
|
|
||||||
-- Go generally requires Tabs instead of spaces.
|
|
||||||
{'FileType', 'go', 'setlocal tabstop=4'},
|
|
||||||
{'FileType', 'go', 'setlocal shiftwidth=4'},
|
|
||||||
{'FileType', 'go', 'setlocal softtabstop=4'},
|
|
||||||
{'FileType', 'go', 'setlocal noexpandtab'},
|
|
||||||
},
|
|
||||||
_dashboard = {
|
|
||||||
-- seems to be nobuflisted that makes my stuff disapear will do more testing
|
|
||||||
{
|
|
||||||
'FileType', 'dashboard',
|
|
||||||
'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= '
|
|
||||||
}, {'FileType', 'dashboard', 'set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2'}
|
|
||||||
},
|
|
||||||
_markdown = {{'FileType', 'markdown', 'setlocal wrap'}, {'FileType', 'markdown', 'setlocal spell'}},
|
|
||||||
_solidity = {
|
|
||||||
{'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'},
|
|
||||||
{'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
|
|
||||||
},
|
|
||||||
_gemini = {
|
|
||||||
{'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'},
|
|
||||||
{'BufNewFile', '*.gmi', 'setlocal filetype=markdown'}
|
|
||||||
},
|
|
||||||
_buffer_bindings = {
|
|
||||||
{'FileType', 'dashboard', 'nnoremap <silent> <buffer> q :q<CR>'},
|
|
||||||
{'FileType', 'lspinfo', 'nnoremap <silent> <buffer> q :q<CR>'},
|
|
||||||
{'FileType', 'floaterm', 'nnoremap <silent> <buffer> q :q<CR>'},
|
|
||||||
},
|
|
||||||
_auto_formatters = auto_formatters
|
|
||||||
})
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
vim.cmd('let g:nvcode_termcolors=256')
|
|
||||||
|
|
||||||
vim.cmd('colorscheme ' .. O.colorscheme)
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
-- Turn off paste mode when leaving insert
|
||||||
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
|
pattern = "*",
|
||||||
|
command = "set nopaste",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Disable the concealing in some file formats
|
||||||
|
-- The default conceallevel is 3 in LazyVim
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = {"*.js","*.tsx","*.ts", "*.json", "*.jsonc", "*.markdown","*.md" },
|
||||||
|
callback = function()
|
||||||
|
vim.opt.conceallevel = 0
|
||||||
|
vim.o.tabstop = 2
|
||||||
|
vim.o.shiftwidth = 2
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
|
||||||
|
local keymap = vim.keymap
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
-- <Leader>a
|
||||||
|
keymap.set('n', "<Leader>aa", "<cmd>@:<cr>", {desc="execute last command again" })
|
||||||
|
|
||||||
|
-- <Leader>b for buffer
|
||||||
|
keymap.set('n', "<Leader>bq", "<cmd>q<cr>", {desc="quit" })
|
||||||
|
keymap.set('n', "<Leader>bs", "<cmd>w<cr>", {desc="save" })
|
||||||
|
keymap.set('n', "<Leader>br", "<cmd>e!<cr>", {desc="reload" })
|
||||||
|
keymap.set('n', "<Leader>bd", "<cmd>BufferClose<cr>", {desc="close buffer" })
|
||||||
|
keymap.set({'n','v'}, "<Leader>b/", "<cmd>CommentToggle<CR>", {desc="toggle comment" })
|
||||||
|
|
||||||
|
-- <Leader>D
|
||||||
|
keymap.set('n', "<Leader>Dt", "<cmd>TroubleToggle<cr>", {desc="trouble" })
|
||||||
|
keymap.set('n', "<Leader>Dw", "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", {desc="workspace" })
|
||||||
|
keymap.set('n', "<Leader>Dd", "<cmd>TroubleToggle lsp_document_diagnostics<cr>", {desc= "document" })
|
||||||
|
keymap.set('n', "<Leader>Dq", "<cmd>TroubleToggle quickfix<cr>", {desc= "quickfix" })
|
||||||
|
keymap.set('n', "<Leader>Dl", "<cmd>TroubleToggle loclist<cr>", {desc= "loclist" })
|
||||||
|
keymap.set('n', "<Leader>Dr", "<cmd>TroubleToggle lsp_references<cr>", {desc= "references" })
|
||||||
|
|
||||||
|
-- <Leader>d
|
||||||
|
keymap.set('n', "<Leader>dd", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", {desc= "show diagnostics" })
|
||||||
|
keymap.set('n', "<Leader>dc", "<cmd>lua require'dap'.continue()<cr>", {desc= "continue" })
|
||||||
|
keymap.set('n', "<Leader>db", ':lua require"dap".toggle_breakpoint()<CR>', {desc= "Toggle Breadpoint" })
|
||||||
|
keymap.set('n', "<Leader>dj", ':lua require"dap".step_over()<CR>', {desc= "step over" })
|
||||||
|
keymap.set('n', "<Leader>dk", ':lua require"dap".step_out()<CR>', {desc= "step out" })
|
||||||
|
keymap.set('n', "<Leader>dl", ':lua require"dap".step_into()<CR>', {desc= "step into" })
|
||||||
|
keymap.set('n', "<Leader>du", ':lua require"dap".up()<CR>', {desc= "up" })
|
||||||
|
keymap.set('n', "<Leader>d_", ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()<CR>', {desc= "disconnect" })
|
||||||
|
keymap.set('n', "<Leader>di", ':lua require"dap.ui.variables".visual_hover()<CR>', {desc= "visual_hover" })
|
||||||
|
keymap.set('n', "<Leader>ds", ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)<CR>', {desc= "centered_float" })
|
||||||
|
|
||||||
|
|
||||||
|
-- <Leader>f
|
||||||
|
keymap.set('n', "<Leader>fm", "<cmd>lua require'utils'.open_md()<cr>", {desc= "open a markdown file in vscode" })
|
||||||
|
keymap.set('n', "<Leader>fs", "<cmd>w<cr>", {desc= "save file" })
|
||||||
|
keymap.set('n', "<Leader>ft", "<cmd>NvimTreeToggle<cr>", {desc= "toggle nvim tree" })
|
||||||
|
keymap.set('n', "<Leader>fr", "<cmd>RnvimrToggle<cr>", {desc= "toggle rnvimr" })
|
||||||
|
keymap.set('n', "<Leader>fy", "<cmd>lua require'utils'.yank_filepath()<cr>", {desc= "copy the file path" })
|
||||||
|
keymap.set('n', "<Leader>fd", "<cmd>lua require'utils'.yank_file_dir()<cr>", {desc= "copy the file path" })
|
||||||
|
keymap.set('n', "<Leader>fl", "<cmd>NvimTreeFindFile<CR>", {desc= "find file" })
|
||||||
|
|
||||||
|
|
||||||
|
-- <Leader>g
|
||||||
|
keymap.set('n', "<Leader>gj", "<cmd>lua require 'gitsigns'.next_hunk()<cr>", {desc= "Next Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gk", "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", {desc= "Prev Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gl", "<cmd>lua require 'gitsigns'.blame_line()<cr>", {desc= "Blame" })
|
||||||
|
keymap.set('n', "<Leader>gp", "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", {desc= "Preview Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gr", "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", {desc= "Reset Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gR", "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", {desc= "Reset Buffer" })
|
||||||
|
keymap.set('n', "<Leader>gs", "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", {desc= "Stage Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gS", "<cmd>lua require 'gitsigns'.stage_buffer()<cr>", {desc= "Stage Buffer" })
|
||||||
|
keymap.set('n', "<Leader>gu", "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>", {desc= "Undo Stage Hunk", })
|
||||||
|
keymap.set('n', "<Leader>go", "<cmd>Telescope git_status<cr>", {desc= "Open changed file" })
|
||||||
|
keymap.set('n', "<Leader>gb", "<cmd>Telescope git_branches<cr>", {desc= "Checkout branch" })
|
||||||
|
keymap.set('n', "<Leader>gc", "<cmd>Telescope git_commits<cr>", {desc= "Checkout commit" })
|
||||||
|
keymap.set('n', "<Leader>gC", "<cmd>Telescope git_bcommits<cr>", {desc= "Checkout commit(for current file)", })
|
||||||
|
keymap.set('n', "<Leader>gd", "<cmd>Gitsigns diffthis HEAD<cr>", {desc= "Git Diff", })
|
||||||
|
|
||||||
|
-- <Leader>h
|
||||||
|
keymap.set('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = true }) -- no hl
|
||||||
|
|
||||||
|
-- <Leader>l for lsp
|
||||||
|
keymap.set('n', '<Leader>l', "", {desc="+Language"})
|
||||||
|
keymap.set('n', '<Leader>la', "<cmd>Lspsaga code_action<cr>", {desc="Code Action" })
|
||||||
|
keymap.set('n', '<Leader>lA', "<cmd>Lspsaga range_code_action<cr>", {desc="Selected Action" })
|
||||||
|
keymap.set('n', '<Leader>ld', "<cmd>Telescope lsp_document_diagnostics<cr>", {desc="Document Diagnostics" })
|
||||||
|
keymap.set('n', '<Leader>lD', "<cmd>Telescope lsp_workspace_diagnostics<cr>", {desc="Workspace Diagnostics" })
|
||||||
|
keymap.set('n', '<Leader>lf', "<cmd>LspFormatting<cr>", {desc="Format" })
|
||||||
|
keymap.set('n', '<Leader>lF', "<cmd>Lspsaga lsp_finder<cr>", {desc="LSP Finder" })
|
||||||
|
keymap.set('n', '<Leader>li', "<cmd>lua vim.lsp.buf.implementation()<cr>", {desc="implement" })
|
||||||
|
keymap.set('n', '<Leader>ll', "<cmd>lua vim.lsp.buf.hover()<cr>", {desc="hover" })
|
||||||
|
keymap.set('n', '<Leader>lL', "<cmd>Lspsaga show_line_diagnostics<cr>", {desc="Line Diagnostics" })
|
||||||
|
keymap.set('n', '<Leader>lk', "<cmd>: LspRestart<cr>", {desc="restart lsp server" })
|
||||||
|
keymap.set('n', '<Leader>ln', "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", {desc="next diagnostic" })
|
||||||
|
keymap.set('n', '<Leader>lo', "<cmd>: SymbolsOutline<cr>", {desc="symbols outline" })
|
||||||
|
keymap.set('n', '<Leader>lp', "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", {desc="prev diagnostic" })
|
||||||
|
keymap.set('n', '<Leader>lP', "<cmd>Lspsaga preview_definition<cr>", {desc="Preview Definition" })
|
||||||
|
keymap.set('n', '<Leader>lq', "<cmd>Telescope quickfix<cr>", {desc="Quickfix" })
|
||||||
|
keymap.set('n', '<Leader>lr', "<cmd>lua vim.lsp.buf.references()<cr>", {desc="references" })
|
||||||
|
keymap.set('n', '<Leader>lR', "<cmd>Lspsaga rename<cr>", {desc="Rename" })
|
||||||
|
keymap.set('n', '<Leader>lt', "<cmd>LspTypeDefinition<cr>", {desc="Type Definition" })
|
||||||
|
keymap.set('n', '<Leader>lx', "<cmd>cclose<cr>", {desc="Close Quickfix" })
|
||||||
|
keymap.set('n', '<Leader>ls', "<cmd>Telescope lsp_document_symbols<cr>", {desc="Document Symbols" })
|
||||||
|
keymap.set('n', '<Leader>lS', "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", {desc="Workspace Symbols" })
|
||||||
|
keymap.set('n', '<Leader>lz', "<cmd>LspInfo<cr>", {desc="Info" })
|
||||||
|
keymap.set('n', '<Leader>l,', "<cmd>LspInstallInfo<cr>", {desc="LSP servers" })
|
||||||
|
|
||||||
|
-- <Leader>q
|
||||||
|
keymap.set('n', "<Leader>qq", "<cmd>qall<cr>", {desc= "quit" })
|
||||||
|
|
||||||
|
|
||||||
|
-- <Leader>s
|
||||||
|
keymap.set('n', "<Leader>sb", "<cmd>Telescope git_branches<cr>", {desc= "Checkout branch" })
|
||||||
|
keymap.set('n', "<Leader>sc", "<cmd>:nohl<cr>", {desc= "no highlight" })
|
||||||
|
keymap.set('n', "<Leader>sd", "<cmd>Telescope lsp_document_diagnostics<cr>", {desc= "Document Diagnostics" })
|
||||||
|
keymap.set('n', "<Leader>sD", "<cmd>Telescope lsp_workspace_diagnostics<cr>", {desc= "Workspace Diagnostics" })
|
||||||
|
keymap.set('n', "<Leader>sf", "<cmd>Telescope find_files<CR><cr>", {desc= "Find File" })
|
||||||
|
keymap.set('n', "<Leader>sr", function() require("telescope.builtin").oldfiles({ cwd = vim.loop.cwd() }) end, {desc= "Old File" })
|
||||||
|
keymap.set('n', "<Leader>sm", "<cmd>Telescope marks<cr>", {desc= "Marks" })
|
||||||
|
keymap.set('n', "<Leader>sM", "<cmd>Telescope man_pages<cr>", {desc= "Man Pages" })
|
||||||
|
keymap.set('n', "<Leader>sR", "<cmd>Telescope registers<cr>", {desc= "Registers" })
|
||||||
|
keymap.set('n', "<Leader>st", "<cmd>Telescope live_grep<cr>", {desc= "Text" })
|
||||||
|
keymap.set('n', "<Leader>sT", "<cmd>Telescope live_grep<cr>", {desc= "Text" })
|
||||||
|
keymap.set('n', "<Leader>s,", "<cmd>FzfLua grep_cword<cr>", {desc= "Search word under cursor" })
|
||||||
|
|
||||||
|
-- <Leader>S
|
||||||
|
keymap.set('n', "<Leader>Ss", "<cmd>SessionSave<cr>", {desc= "Save Session" })
|
||||||
|
keymap.set('n', "<Leader>Sl", "<cmd>SessionLoad<cr>", {desc= "Load Session" })
|
||||||
|
|
||||||
|
-- <Leader>t
|
||||||
|
keymap.set('n', "<Leader>ta", "<cmd>TestSuite -v -cover<cr>", {desc= "TestSuite" })
|
||||||
|
keymap.set('n', "<Leader>tt", "<cmd>lua require('neotest').run.run() <cr>", {desc= "TestNearest" })
|
||||||
|
keymap.set('n', "<Leader>tf", '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))<cr>', {desc= "TestFile" })
|
||||||
|
keymap.set('n', "<Leader>tc", "<cmd>GoCover<cr>", {desc="go coverage" })
|
||||||
|
keymap.set('n', "<Leader>tC", "<cmd>GoCoverClear<cr>", {desc= "go coverage clear" })
|
||||||
|
keymap.set('n', "<Leader>tb", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", {desc= "set break point" })
|
||||||
|
keymap.set('n', "<Leader>tr", "<cmd>lua require'dap'.continue()<cr>", {desc= "continue" })
|
||||||
|
keymap.set('n', "<Leader>zs", "<cmd>TZBottom<cr>", {desc="toggle status line" })
|
||||||
|
keymap.set('n', "<Leader>zt", "<cmd>TZTop<cr>", {desc= "toggle tab bar" })
|
||||||
|
keymap.set('n', "<Leader>zz", "<cmd>TZAtaraxis<cr>", {desc= "toggle zen" })
|
||||||
|
|
||||||
|
-- <Leader>;
|
||||||
|
keymap.set('n', '<Leader>;', ':Dashboard<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- Ctrl
|
||||||
|
keymap.set('n', '<C-p>', ":Telescope find_files<CR>", { noremap = true, silent = true })
|
||||||
|
-- better window movement
|
||||||
|
keymap.set('n', '<C-h>', '<C-w>h', { silent = true })
|
||||||
|
keymap.set('n', '<C-j>', '<C-w>j', { silent = true })
|
||||||
|
keymap.set('n', '<C-k>', '<C-w>k', { silent = true })
|
||||||
|
keymap.set('n', '<C-l>', '<C-w>l', { silent = true })
|
||||||
|
-- resize with arrows
|
||||||
|
keymap.set('n', '<C-Up>', ':resize -2<CR>', { silent = true })
|
||||||
|
keymap.set('n', '<C-Down>', ':resize +2<CR>', { silent = true })
|
||||||
|
keymap.set('n', '<C-Left>', ':vertical resize -2<CR>', { silent = true })
|
||||||
|
keymap.set('n', '<C-Right>', ':vertical resize +2<CR>', { silent = true })
|
||||||
|
|
||||||
|
keymap.set('n', '<C-q>', ':call QuickFixToggle()<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
|
||||||
|
-- Other
|
||||||
|
-- better edit
|
||||||
|
keymap.set('n', 'Y', 'y$', {})
|
||||||
|
-- better indenting
|
||||||
|
keymap.set('v', '<', '<gv', { noremap = true, silent = true })
|
||||||
|
keymap.set('v', '>', '>gv', { noremap = true, silent = true })
|
||||||
|
-- I hate escape
|
||||||
|
keymap.set('i', 'jk', '<ESC>', { noremap = true, silent = true })
|
||||||
|
keymap.set('i', 'kj', '<ESC>', { noremap = true, silent = true })
|
||||||
|
keymap.set('i', 'jj', '<ESC>', { noremap = true, silent = true })
|
||||||
|
-- Tab switch buffer
|
||||||
|
keymap.set('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
|
||||||
|
keymap.set('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
|
||||||
|
-- Move selected line / block of text in visual mode
|
||||||
|
keymap.set('x', 'K', ':move \'<-2<CR>gv-gv', { noremap = true, silent = true })
|
||||||
|
keymap.set('x', 'J', ':move \'>+1<CR>gv-gv', { noremap = true, silent = true })
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
-- bootstrap lazy.nvim
|
||||||
|
-- stylua: ignore
|
||||||
|
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- add LazyVim and import its plugins
|
||||||
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
|
-- import any extras modules here
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||||
|
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||||
|
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||||
|
-- import/override with your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
defaults = {
|
||||||
|
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||||
|
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||||
|
lazy = false,
|
||||||
|
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||||
|
-- have outdated releases, which may break your Neovim install.
|
||||||
|
version = false, -- always use the latest git commit
|
||||||
|
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||||
|
},
|
||||||
|
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||||
|
checker = { enabled = false}, -- automatically check for plugin updates
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
-- disable some rtp plugins
|
||||||
|
disabled_plugins = {
|
||||||
|
"gzip",
|
||||||
|
-- "matchit",
|
||||||
|
-- "matchparen",
|
||||||
|
-- "netrwPlugin",
|
||||||
|
"tarPlugin",
|
||||||
|
"tohtml",
|
||||||
|
"tutor",
|
||||||
|
"zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object"
|
||||||
|
vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|.
|
||||||
|
vim.cmd('set inccommand=split') -- Make substitution work in realtime
|
||||||
|
vim.opt.hidden = true -- Required to keep multiple buffers open multiple buffers
|
||||||
|
vim.opt.title = true
|
||||||
|
TERMINAL = vim.fn.expand('$TERMINAL')
|
||||||
|
vim.cmd('let &titleold="'..TERMINAL..'"')
|
||||||
|
vim.opt.titlestring="%<%F%=%l/%L - nvim"
|
||||||
|
vim.wo.wrap = true -- Display long lines as just one line
|
||||||
|
vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
|
||||||
|
vim.cmd('syntax on') -- syntax highlighting
|
||||||
|
vim.opt.pumheight = 10 -- Makes popup menu smaller
|
||||||
|
vim.opt.fileencoding = "utf-8" -- The encoding written to file
|
||||||
|
vim.opt.cmdheight = 2 -- More space for displaying messages
|
||||||
|
vim.cmd('set colorcolumn=99999') -- fix indentline for now
|
||||||
|
vim.opt.mouse = "a" -- Enable your mouse
|
||||||
|
vim.opt.splitbelow = true -- Horizontal splits will automatically be below
|
||||||
|
vim.opt.termguicolors = true -- set term gui colors most terminals support this
|
||||||
|
vim.opt.splitright = true -- Vertical splits will automatically be to the right
|
||||||
|
-- vim.opt.t_Co = "256" -- Support 256 colors
|
||||||
|
vim.opt.conceallevel = 0 -- So that I can see `` in markdown files
|
||||||
|
vim.o.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.bo.smartindent = true -- Makes indenting smart
|
||||||
|
vim.wo.number = true -- set numbered lines
|
||||||
|
vim.wo.relativenumber = true -- set relative number
|
||||||
|
vim.wo.cursorline = true -- Enable highlighting of the current line
|
||||||
|
vim.opt.showtabline = 2 -- Always show tabs
|
||||||
|
vim.opt.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
||||||
|
vim.opt.backup = false -- This is recommended by coc
|
||||||
|
vim.opt.writebackup = false -- This is recommended by coc
|
||||||
|
vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
|
vim.opt.updatetime = 300 -- Faster completion
|
||||||
|
vim.opt.timeoutlen = 100 -- By default timeoutlen is 1000 ms
|
||||||
|
vim.opt.clipboard = "unnamedplus" -- Copy paste between vim and everything else
|
||||||
|
vim.cmd('filetype plugin on') -- filetype detection
|
||||||
|
-- vim.opt.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18"
|
||||||
|
-- vim.opt.guifont = "Hack\\ Nerd\\ Font\\ Mono"
|
||||||
|
-- vim.opt.guifont = "SauceCodePro Nerd Font:h17"
|
||||||
|
vim.opt.guifont = "FiraCode Nerd Font:h17"
|
||||||
|
|
||||||
|
-- vim.opt.guifont = "JetBrains\\ Mono\\ Regular\\ Nerd\\ Font\\ Complete"
|
||||||
|
vim.g.vim_markdown_folding_disabled = 1
|
||||||
|
|
||||||
|
vim.g.vimspector_enable_mappings = 'HUMAN'
|
||||||
|
vim.g['test#go#rspec#options'] = { nearest= '--v', suite= '--v' }
|
||||||
|
|
||||||
|
-- git blame
|
||||||
|
vim.cmd('highlight default link gitblame SpecialComment')
|
||||||
|
vim.g.gitblame_enabled = 0
|
||||||
|
|
||||||
|
-- last position jump
|
||||||
|
vim.cmd([[
|
||||||
|
autocmd BufReadPost * if line("'\"") >= 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- vim.cmd('let g:nvcode_termcolors=256')
|
||||||
|
-- --local cc = 'gruvbox'
|
||||||
|
-- local cc = 'lunar'
|
||||||
|
-- vim.opt.background="dark"
|
||||||
|
-- vim.cmd('colorscheme ' .. cc)
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
vim.api.nvim_set_keymap('n', '-', ':RnvimrToggle<CR>', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- better window movement
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { silent = true })
|
|
||||||
|
|
||||||
-- better edit
|
|
||||||
vim.api.nvim_set_keymap('n', 'Y', 'y$', {})
|
|
||||||
|
|
||||||
-- TODO fix this
|
|
||||||
-- Terminal window navigation
|
|
||||||
-- vim.cmd([[
|
|
||||||
-- tnoremap <C-h> <C-\><C-N><C-w>h
|
|
||||||
-- tnoremap <C-j> <C-\><C-N><C-w>j
|
|
||||||
-- tnoremap <C-k> <C-\><C-N><C-w>k
|
|
||||||
-- tnoremap <C-l> <C-\><C-N><C-w>l
|
|
||||||
-- inoremap <C-h> <C-\><C-N><C-w>h
|
|
||||||
-- inoremap <C-j> <C-\><C-N><C-w>j
|
|
||||||
-- inoremap <C-k> <C-\><C-N><C-w>k
|
|
||||||
-- inoremap <C-l> <C-\><C-N><C-w>l
|
|
||||||
-- tnoremap <Esc> <C-\><C-n>
|
|
||||||
-- ]])
|
|
||||||
|
|
||||||
-- TODO fix this
|
|
||||||
-- resize with arrows
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-Up>', ':resize -2<CR>', { silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-Down>', ':resize +2<CR>', { silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-Left>', ':vertical resize -2<CR>', { silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-Right>', ':vertical resize +2<CR>', { silent = true })
|
|
||||||
|
|
||||||
-- better indenting
|
|
||||||
vim.api.nvim_set_keymap('v', '<', '<gv', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('v', '>', '>gv', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- I hate escape
|
|
||||||
vim.api.nvim_set_keymap('i', 'jk', '<ESC>', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('i', 'kj', '<ESC>', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('i', 'jj', '<ESC>', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- Tab switch buffer
|
|
||||||
vim.api.nvim_set_keymap('n', '<TAB>', ':bnext<CR>', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<S-TAB>', ':bprevious<CR>', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- Move selected line / block of text in visual mode
|
|
||||||
vim.api.nvim_set_keymap('x', 'K', ':move \'<-2<CR>gv-gv', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('x', 'J', ':move \'>+1<CR>gv-gv', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- Better nav for omnicomplete
|
|
||||||
vim.cmd('inoremap <expr> <c-j> (\"\\<C-n>\")')
|
|
||||||
vim.cmd('inoremap <expr> <c-k> (\"\\<C-p>\")')
|
|
||||||
|
|
||||||
vim.cmd('vnoremap p "0p')
|
|
||||||
vim.cmd('vnoremap P "0P')
|
|
||||||
-- vim.api.nvim_set_keymap('v', 'p', '"0p', {silent = true})
|
|
||||||
-- vim.api.nvim_set_keymap('v', 'P', '"0P', {silent = true})
|
|
||||||
|
|
||||||
-- vim.cmd('inoremap <expr> <TAB> (\"\\<C-n>\")')
|
|
||||||
-- vim.cmd('inoremap <expr> <S-TAB> (\"\\<C-p>\")')
|
|
||||||
|
|
||||||
-- vim.api.nvim_set_keymap('i', '<C-TAB>', 'compe#complete()', {noremap = true, silent = true, expr = true})
|
|
||||||
|
|
||||||
-- vim.cmd([[
|
|
||||||
-- map p <Plug>(miniyank-autoput)
|
|
||||||
-- map P <Plug>(miniyank-autoPut)
|
|
||||||
-- map <leader>n <Plug>(miniyank-cycle)
|
|
||||||
-- map <leader>N <Plug>(miniyank-cycleback)
|
|
||||||
-- ]])
|
|
||||||
|
|
||||||
-- Toggle the QuickFix window
|
|
||||||
vim.api.nvim_set_keymap('', '<C-q>', ':call QuickFixToggle()<CR>', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- nvim-compe key map
|
|
||||||
-- vim.cmd('inoremap <silent><expr> <C-Space> compe#complete()')
|
|
||||||
-- vim.cmd("inoremap <silent><expr> <CR> compe#confirm('<CR>')")
|
|
||||||
-- vim.cmd("inoremap <silent><expr> <C-e> compe#close('<C-e>')")
|
|
||||||
-- vim.cmd("inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })")
|
|
||||||
-- vim.cmd("inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })")
|
|
||||||
@@ -2,7 +2,17 @@
|
|||||||
require 'lspconfig'.gopls.setup {
|
require 'lspconfig'.gopls.setup {
|
||||||
-- cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
|
-- cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
|
||||||
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
|
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
|
||||||
settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } },
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
analyses = {
|
||||||
|
nilness = true,
|
||||||
|
unusedparams = true,
|
||||||
|
unusedwrite = true,
|
||||||
|
useany = true,
|
||||||
|
},
|
||||||
|
staticcheck = false
|
||||||
|
}
|
||||||
|
},
|
||||||
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
|
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
|
||||||
init_options = { usePlaceholders = true, completeUnimported = true },
|
init_options = { usePlaceholders = true, completeUnimported = true },
|
||||||
on_attach = require 'lsp'.common_on_attach
|
on_attach = require 'lsp'.common_on_attach
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
-- TODO figure out why this don't work
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"LspDiagnosticsSignError",
|
|
||||||
{ texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError" }
|
|
||||||
)
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"LspDiagnosticsSignWarning",
|
|
||||||
{ texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning" }
|
|
||||||
)
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"LspDiagnosticsSignHint",
|
|
||||||
{ texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint" }
|
|
||||||
)
|
|
||||||
vim.fn.sign_define(
|
|
||||||
"LspDiagnosticsSignInformation",
|
|
||||||
{ texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation" }
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.cmd("nnoremap gd <cmd>lua vim.lsp.buf.definition()<CR>")
|
|
||||||
vim.cmd("nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>")
|
|
||||||
vim.cmd("nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>")
|
|
||||||
vim.cmd("nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>")
|
|
||||||
vim.cmd("nnoremap <silent> ca :Lspsaga code_action<CR>")
|
|
||||||
vim.cmd("nnoremap <silent> K :Lspsaga hover_doc<CR>")
|
|
||||||
-- vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>')
|
|
||||||
vim.cmd("nnoremap <silent> <C-m> :Lspsaga diagnostic_jump_prev<CR>")
|
|
||||||
vim.cmd("nnoremap <silent> <C-n> :Lspsaga diagnostic_jump_next<CR>")
|
|
||||||
-- scroll down hover doc or scroll in definition preview
|
|
||||||
vim.cmd("nnoremap <silent> <C-f> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>")
|
|
||||||
-- scroll up hover doc
|
|
||||||
vim.cmd("nnoremap <silent> <C-b> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>")
|
|
||||||
vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()')
|
|
||||||
|
|
||||||
-- Set Default Prefix.
|
|
||||||
-- Note: You can set a prefix per lsp server in the lv-globals.lua file
|
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
|
||||||
virtual_text = {
|
|
||||||
prefix = "",
|
|
||||||
spacing = 0,
|
|
||||||
},
|
|
||||||
signs = true,
|
|
||||||
underline = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- symbols for autocomplete
|
|
||||||
vim.lsp.protocol.CompletionItemKind = {
|
|
||||||
" (Text) ",
|
|
||||||
" (Method)",
|
|
||||||
" (Function)",
|
|
||||||
" (Constructor)",
|
|
||||||
" ﴲ (Field)",
|
|
||||||
"[] (Variable)",
|
|
||||||
" (Class)",
|
|
||||||
" ﰮ (Interface)",
|
|
||||||
" (Module)",
|
|
||||||
" 襁 (Property)",
|
|
||||||
" (Unit)",
|
|
||||||
" (Value)",
|
|
||||||
" 練 (Enum)",
|
|
||||||
" (Keyword)",
|
|
||||||
" (Snippet)",
|
|
||||||
" (Color)",
|
|
||||||
" (File)",
|
|
||||||
" (Reference)",
|
|
||||||
" (Folder)",
|
|
||||||
" (EnumMember)",
|
|
||||||
" ﲀ (Constant)",
|
|
||||||
" ﳤ (Struct)",
|
|
||||||
" (Event)",
|
|
||||||
" (Operator)",
|
|
||||||
" (TypeParameter)"
|
|
||||||
}
|
|
||||||
|
|
||||||
--[[ " autoformat
|
|
||||||
autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100)
|
|
||||||
autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100)
|
|
||||||
autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100) ]]
|
|
||||||
-- Java
|
|
||||||
-- autocmd FileType java nnoremap ca <Cmd>lua require('jdtls').code_action()<CR>
|
|
||||||
|
|
||||||
local function documentHighlight(client, bufnr)
|
|
||||||
-- Set autocommands conditional on server_capabilities
|
|
||||||
if client.server_capabilities.document_highlight then
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
hi LspReferenceRead cterm=bold ctermbg=red guibg=#464646
|
|
||||||
hi LspReferenceText cterm=bold ctermbg=red guibg=#464646
|
|
||||||
hi LspReferenceWrite cterm=bold ctermbg=red guibg=#464646
|
|
||||||
augroup lsp_document_highlight
|
|
||||||
autocmd! * <buffer>
|
|
||||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
|
||||||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
|
||||||
augroup END
|
|
||||||
]] ,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local lsp_config = {}
|
|
||||||
|
|
||||||
if O.document_highlight then
|
|
||||||
function lsp_config.common_on_attach(client, bufnr)
|
|
||||||
documentHighlight(client, bufnr)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--function lsp_config.tsserver_on_attach(client, bufnr)
|
|
||||||
-- lsp_config.common_on_attach(client, bufnr)
|
|
||||||
-- client.server_capabilities.document_formatting = false
|
|
||||||
--end
|
|
||||||
|
|
||||||
-- Use a loop to conveniently both setup defined servers
|
|
||||||
-- and map buffer local keybindings when the language server attaches
|
|
||||||
-- local servers = {"pyright", "tsserver"}
|
|
||||||
-- for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end
|
|
||||||
return lsp_config
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
O = {
|
|
||||||
extras = false,
|
|
||||||
|
|
||||||
--database = {save_location = '~/.config/nvcode_db', auto_execute = 1},
|
|
||||||
python = {
|
|
||||||
linter = '',
|
|
||||||
-- @usage can be 'yapf', 'black'
|
|
||||||
formatter = '',
|
|
||||||
autoformat = false,
|
|
||||||
isort = false,
|
|
||||||
diagnostics = {virtual_text = {spacing = 0, prefix = ""}, signs = true, underline = true},
|
|
||||||
analysis = {type_checking = "basic", auto_search_paths = true, use_library_code_types = true}
|
|
||||||
},
|
|
||||||
dart = {sdk_path = '/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot'},
|
|
||||||
lua = {
|
|
||||||
-- @usage can be 'lua-format'
|
|
||||||
formatter = '',
|
|
||||||
autoformat = false,
|
|
||||||
diagnostics = {virtual_text = {spacing = 0, prefix = ""}, signs = true, underline = true}
|
|
||||||
},
|
|
||||||
sh = {
|
|
||||||
-- @usage can be 'shellcheck'
|
|
||||||
linter = '',
|
|
||||||
-- @usage can be 'shfmt'
|
|
||||||
formatter = '',
|
|
||||||
autoformat = false,
|
|
||||||
diagnostics = {virtual_text = {spacing = 0, prefix = ""}, signs = true, underline = true}
|
|
||||||
},
|
|
||||||
tsserver = {
|
|
||||||
-- @usage can be 'eslint'
|
|
||||||
linter = '',
|
|
||||||
-- @usage can be 'prettier'
|
|
||||||
formatter = '',
|
|
||||||
autoformat = false,
|
|
||||||
diagnostics = {virtual_text = {spacing = 0, prefix = ""}, signs = true, underline = true}
|
|
||||||
},
|
|
||||||
json = {
|
|
||||||
-- @usage can be 'prettier'
|
|
||||||
formatter = '',
|
|
||||||
autoformat = false,
|
|
||||||
diagnostics = {virtual_text = {spacing = 0, prefix = ""}, signs = true, underline = true}
|
|
||||||
},
|
|
||||||
tailwindls = {filetypes = {'html', 'css', 'scss', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact'}},
|
|
||||||
clang = {diagnostics = {virtual_text = {spacing = 0, prefix = ""}, signs = true, underline = true}},
|
|
||||||
ruby = {
|
|
||||||
diagnostics = {virtualtext = {spacing = 0, prefix = ""}, signs = true, underline = true},
|
|
||||||
filetypes = {'rb', 'erb', 'rakefile'}
|
|
||||||
},
|
|
||||||
go = {},
|
|
||||||
-- css = {formatter = '', autoformat = false, virtual_text = true},
|
|
||||||
-- json = {formatter = '', autoformat = false, virtual_text = true}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _G.put(...)
|
|
||||||
local objects = {}
|
|
||||||
for i = 1, select('#', ...) do
|
|
||||||
local v = select(i, ...)
|
|
||||||
table.insert(objects, vim.inspect(v))
|
|
||||||
end
|
|
||||||
|
|
||||||
print(table.concat(objects, '\n'))
|
|
||||||
return ...
|
|
||||||
end
|
|
||||||
@@ -9,11 +9,6 @@ require('gitsigns').setup {
|
|||||||
},
|
},
|
||||||
numhl = false,
|
numhl = false,
|
||||||
linehl = false,
|
linehl = false,
|
||||||
keymaps = {
|
|
||||||
-- Default keymap options
|
|
||||||
noremap = true,
|
|
||||||
buffer = true,
|
|
||||||
},
|
|
||||||
watch_gitdir = {
|
watch_gitdir = {
|
||||||
interval = 1000
|
interval = 1000
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,18 +5,20 @@ require('pluginconfig/dashboard-nvim')
|
|||||||
require('pluginconfig/galaxyline')
|
require('pluginconfig/galaxyline')
|
||||||
require('pluginconfig/gitsigns')
|
require('pluginconfig/gitsigns')
|
||||||
require('pluginconfig/hop')
|
require('pluginconfig/hop')
|
||||||
require('pluginconfig/lspinstall')
|
require('pluginconfig/mason')
|
||||||
require('pluginconfig/neodev') -- must before lspconfig
|
require('pluginconfig/neodev') -- must before lspconfig
|
||||||
require('pluginconfig/mkdx')
|
require('pluginconfig/mkdx')
|
||||||
require('pluginconfig/neotest')
|
require('pluginconfig/neotest')
|
||||||
require('pluginconfig/numb')
|
require('pluginconfig/numb')
|
||||||
require('pluginconfig/nvim-autopairs')
|
require('pluginconfig/nvim-autopairs')
|
||||||
require('pluginconfig/nvim-colorizer')
|
|
||||||
require('pluginconfig/nvim-cmp')
|
require('pluginconfig/nvim-cmp')
|
||||||
|
require('pluginconfig/nvim-colorizer')
|
||||||
|
require('pluginconfig/nvim-lint')
|
||||||
require('pluginconfig/fzf-lua')
|
require('pluginconfig/fzf-lua')
|
||||||
require('pluginconfig/nvim-tree') -- This plugin must be required somewhere before colorscheme. Placing it after will break navigation keymappings
|
require('pluginconfig/nvim-tree') -- This plugin must be required somewhere before colorscheme. Placing it after will break navigation keymappings
|
||||||
require('pluginconfig/nvim-treesitter')
|
require('pluginconfig/nvim-treesitter')
|
||||||
require('pluginconfig/rnvimr')
|
require('pluginconfig/rnvimr')
|
||||||
|
require('pluginconfig/symbols-outline')
|
||||||
require('pluginconfig/telescope')
|
require('pluginconfig/telescope')
|
||||||
require('pluginconfig/toggleterm')
|
require('pluginconfig/toggleterm')
|
||||||
require('pluginconfig/vim-matchup')
|
require('pluginconfig/vim-matchup')
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
local lsp_installer = require("nvim-lsp-installer")
|
|
||||||
lsp_installer.settings({
|
|
||||||
install_root_dir = table.concat { vim.fn.stdpath("data"), "/lspinstall" },
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished
|
|
||||||
-- or if the server is already installed).
|
|
||||||
lsp_installer.on_server_ready(function(server)
|
|
||||||
local opts = {
|
|
||||||
}
|
|
||||||
|
|
||||||
-- (optional) Customize the options passed to the server
|
|
||||||
-- if server.name == "tsserver" then
|
|
||||||
-- opts.root_dir = function() ... end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- This setup() function will take the provided server configuration and decorate it with the necessary properties
|
|
||||||
-- before passing it onwards to lspconfig.
|
|
||||||
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
|
||||||
server:setup(opts)
|
|
||||||
end)
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
require("mason").setup()
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
local lint_lib = require('lint')
|
||||||
|
|
||||||
|
lint_lib.linters_by_ft = {
|
||||||
|
go = {'golangcilint'}
|
||||||
|
}
|
||||||
|
|
||||||
|
local golangcilint = lint_lib.linters.golangcilint
|
||||||
|
golangcilint.args = {
|
||||||
|
'run',
|
||||||
|
'--config',
|
||||||
|
'~/.dotfile/.golangci_strict.yml',
|
||||||
|
'--out-format',
|
||||||
|
'json',
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
|
callback = function()
|
||||||
|
require("lint").try_lint()
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -1,5 +1,24 @@
|
|||||||
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
|
local function my_on_attach(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
|
||||||
|
|
||||||
|
-- default mappings
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
|
|
||||||
|
-- custom mappings
|
||||||
|
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||||
|
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||||
|
vim.keymap.set('n', 'l', api.node.open.edit, opts('Edit'))
|
||||||
|
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Parent Close'))
|
||||||
|
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Horizontal Split'))
|
||||||
|
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Vertical Split'))
|
||||||
|
end
|
||||||
|
|
||||||
require'nvim-tree'.setup {
|
require'nvim-tree'.setup {
|
||||||
|
on_attach = my_on_attach,
|
||||||
disable_netrw = true,
|
disable_netrw = true,
|
||||||
hijack_netrw = true,
|
hijack_netrw = true,
|
||||||
--auto_close = false,
|
--auto_close = false,
|
||||||
@@ -17,51 +36,11 @@ require'nvim-tree'.setup {
|
|||||||
enable = true,
|
enable = true,
|
||||||
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
||||||
-- only relevant when `update_focused_file.enable` is true
|
-- only relevant when `update_focused_file.enable` is true
|
||||||
update_cwd = true,
|
update_cwd = false,
|
||||||
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
||||||
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||||
ignore_list = {}
|
ignore_list = {}
|
||||||
},
|
},
|
||||||
view = {
|
|
||||||
mappings = {
|
|
||||||
--custome_only= false,
|
|
||||||
list = {
|
|
||||||
-- ["<CR>"] = ":YourVimFunction()<cr>",
|
|
||||||
-- ["u"] = ":lua require'some_module'.some_function()<cr>",
|
|
||||||
|
|
||||||
-- default mappings
|
|
||||||
{key="<CR>" ,cb= tree_cb("edit")},
|
|
||||||
{key="o" ,cb= tree_cb("edit")},
|
|
||||||
{key="l" ,action="edit"},
|
|
||||||
{key="<2-LeftMouse>" ,cb= tree_cb("edit")},
|
|
||||||
{key="<2-RightMouse>" ,cb= tree_cb("cd")},
|
|
||||||
{key="<C->" ,cb= tree_cb("cd")},
|
|
||||||
{key="v" ,cb= tree_cb("vsplit")},
|
|
||||||
{key="s" ,cb= tree_cb("split")},
|
|
||||||
{key="<C-t>" ,cb= tree_cb("tabnew")},
|
|
||||||
{key="<" ,cb= tree_cb("prev_sibling")},
|
|
||||||
{key=">" ,cb= tree_cb("next_sibling")},
|
|
||||||
{key="<BS>" ,cb= tree_cb("close_node")},
|
|
||||||
{key="h" ,action="close_node"},
|
|
||||||
{key="<S-CR>" ,cb= tree_cb("close_node")},
|
|
||||||
{key="<Tab>" ,cb= tree_cb("preview")},
|
|
||||||
{key="I" ,cb= tree_cb("toggle_ignored")},
|
|
||||||
{key="H" ,cb= tree_cb("toggle_dotfiles")},
|
|
||||||
{key="R" ,cb= tree_cb("refresh")},
|
|
||||||
{key="a" ,cb= tree_cb("create")},
|
|
||||||
{key="d" ,cb= tree_cb("remove")},
|
|
||||||
{key="r" ,cb= tree_cb("rename")},
|
|
||||||
{key="<C-r>" ,cb= tree_cb("full_rename")},
|
|
||||||
{key="x" ,cb= tree_cb("cut")},
|
|
||||||
{key="c" ,cb= tree_cb("copy")},
|
|
||||||
{key="p" ,cb= tree_cb("paste")},
|
|
||||||
{key="[c" ,cb= tree_cb("prev_git_item")},
|
|
||||||
{key="c" ,cb= tree_cb("next_git_item")},
|
|
||||||
{key="-" ,cb= tree_cb("dir_up")},
|
|
||||||
{key="q" ,cb= tree_cb("close")},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
||||||
@@ -73,3 +52,4 @@ vim.g.nvim_tree_icons = {
|
|||||||
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
||||||
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
require("symbols-outline").setup()
|
||||||
@@ -181,6 +181,7 @@ local mappings = {
|
|||||||
L = { "<cmd>Lspsaga show_line_diagnostics<cr>", "Line Diagnostics" },
|
L = { "<cmd>Lspsaga show_line_diagnostics<cr>", "Line Diagnostics" },
|
||||||
k = { "<cmd>: LspRestart<cr>", "restart lsp server" },
|
k = { "<cmd>: LspRestart<cr>", "restart lsp server" },
|
||||||
n = { "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", "next diagnostic" },
|
n = { "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", "next diagnostic" },
|
||||||
|
o = { "<cmd>: SymbolsOutline<cr>", "symbols outline" },
|
||||||
p = { "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", "prev diagnostic" },
|
p = { "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", "prev diagnostic" },
|
||||||
P = { "<cmd>Lspsaga preview_definition<cr>", "Preview Definition" },
|
P = { "<cmd>Lspsaga preview_definition<cr>", "Preview Definition" },
|
||||||
q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
|
q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
|
||||||
|
|||||||
@@ -1,258 +0,0 @@
|
|||||||
local execute = vim.api.nvim_command
|
|
||||||
local fn = vim.fn
|
|
||||||
|
|
||||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
|
||||||
|
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
|
||||||
execute("!git clone --depth 1 https://github.com/wbthomason/packer.nvim " .. install_path)
|
|
||||||
execute "packadd packer.nvim"
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Check if a file or directory exists in this path
|
|
||||||
local function require_plugin(plugin)
|
|
||||||
local plugin_prefix = fn.stdpath("data") .. "/site/pack/packer/opt/"
|
|
||||||
|
|
||||||
local plugin_path = plugin_prefix .. plugin .. "/"
|
|
||||||
-- print('test '..plugin_path)
|
|
||||||
local ok, err, code = os.rename(plugin_path, plugin_path)
|
|
||||||
if not ok then
|
|
||||||
if code == 13 then
|
|
||||||
-- Permission denied, but it exists
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if ok then vim.cmd("packadd " .. plugin) end
|
|
||||||
if not ok then
|
|
||||||
print(ok, err, code)
|
|
||||||
end
|
|
||||||
return ok, err, code
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
|
|
||||||
|
|
||||||
return require("packer").startup(function(use)
|
|
||||||
-- Packer can manage itself as an optional plugin
|
|
||||||
use "wbthomason/packer.nvim"
|
|
||||||
|
|
||||||
-- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
|
|
||||||
use { "neovim/nvim-lspconfig", opt = true }
|
|
||||||
use { 'tami5/lspsaga.nvim', opt = true }
|
|
||||||
use { "williamboman/nvim-lsp-installer", opt = true }
|
|
||||||
use { "folke/trouble.nvim", opt = true }
|
|
||||||
use { 'stevearc/aerial.nvim', config = function() require('aerial').setup() end }
|
|
||||||
|
|
||||||
-- Telescope
|
|
||||||
use { "nvim-lua/popup.nvim", opt = true }
|
|
||||||
use { "nvim-lua/plenary.nvim", opt = true }
|
|
||||||
use { "nvim-telescope/telescope.nvim", opt = true }
|
|
||||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
|
||||||
use { "nvim-telescope/telescope-project.nvim", opt = true }
|
|
||||||
use { "nvim-telescope/telescope-file-browser.nvim" }
|
|
||||||
|
|
||||||
use { 'ibhagwan/fzf-lua',
|
|
||||||
-- optional for icon support
|
|
||||||
requires = { 'kyazdani42/nvim-web-devicons' }
|
|
||||||
}
|
|
||||||
|
|
||||||
use { 'folke/neodev.nvim' }
|
|
||||||
use { "rafcamlet/nvim-luapad" }
|
|
||||||
|
|
||||||
-- Debugging
|
|
||||||
use { "mfussenegger/nvim-dap", opt = true }
|
|
||||||
|
|
||||||
-- nvim-cmp
|
|
||||||
use 'hrsh7th/cmp-nvim-lsp' -- { name = nvim_lsp }
|
|
||||||
use 'hrsh7th/cmp-buffer' -- { name = 'buffer' },
|
|
||||||
use 'hrsh7th/cmp-path' -- { name = 'path' }
|
|
||||||
use 'hrsh7th/cmp-cmdline' -- { name = 'cmdline' }
|
|
||||||
use 'hrsh7th/nvim-cmp'
|
|
||||||
-- vsnip
|
|
||||||
use 'hrsh7th/cmp-vsnip' -- { name = 'vsnip' }
|
|
||||||
use 'hrsh7th/vim-vsnip'
|
|
||||||
use 'rafamadriz/friendly-snippets'
|
|
||||||
-- lspkind
|
|
||||||
use 'onsails/lspkind-nvim'
|
|
||||||
|
|
||||||
-- Treesitter
|
|
||||||
use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }
|
|
||||||
use { "windwp/nvim-ts-autotag", opt = true }
|
|
||||||
use { 'andymass/vim-matchup', opt = true }
|
|
||||||
|
|
||||||
-- Explorer
|
|
||||||
use {
|
|
||||||
'kyazdani42/nvim-tree.lua',
|
|
||||||
requires = 'kyazdani42/nvim-web-devicons',
|
|
||||||
opt = true,
|
|
||||||
config = function() require 'nvim-tree'.setup {} end
|
|
||||||
}
|
|
||||||
use { "ahmedkhalf/lsp-rooter.nvim", opt = true } -- with this nvim-tree will follow you
|
|
||||||
-- TODO remove when open on dir is supported by nvimtree
|
|
||||||
use "kevinhwang91/rnvimr"
|
|
||||||
|
|
||||||
-- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'}
|
|
||||||
use { 'lewis6991/gitsigns.nvim', opt = true, requires = { 'nvim-lua/plenary.nvim' } }
|
|
||||||
use { "folke/which-key.nvim", opt = true }
|
|
||||||
use { "ChristianChiarulli/dashboard-nvim", opt = true }
|
|
||||||
use { "windwp/nvim-autopairs", opt = true }
|
|
||||||
use { "kevinhwang91/nvim-bqf", opt = true }
|
|
||||||
|
|
||||||
-- Comments
|
|
||||||
use { "terrortylor/nvim-comment", opt = true }
|
|
||||||
use { 'JoosepAlviste/nvim-ts-context-commentstring', opt = true }
|
|
||||||
|
|
||||||
-- Color
|
|
||||||
use { "christianchiarulli/nvcode-color-schemes.vim", opt = true }
|
|
||||||
use { "npxbr/gruvbox.nvim", requires = { "rktjmp/lush.nvim" } }
|
|
||||||
|
|
||||||
-- Icons
|
|
||||||
use { "kyazdani42/nvim-web-devicons", opt = true }
|
|
||||||
|
|
||||||
-- Status Line and Bufferline
|
|
||||||
use { "glepnir/galaxyline.nvim", opt = true }
|
|
||||||
use { "romgrk/barbar.nvim", opt = true }
|
|
||||||
|
|
||||||
use({ "L3MON4D3/LuaSnip", tag = "v1.0.0", opt = true })
|
|
||||||
|
|
||||||
-- Go plugin
|
|
||||||
-- use {"fatih/vim-go", run= ":GoUpdateBinaries"}
|
|
||||||
-- use {"fatih/vim-go", run = ":GoUpdateBinaries", ft = "go"}
|
|
||||||
-- require_plugin("fatih/vim-go")
|
|
||||||
-- debuger
|
|
||||||
--use { "puremourning/vimspector", opt = true }
|
|
||||||
--require_plugin("vimspector")
|
|
||||||
|
|
||||||
-- vim test
|
|
||||||
use({
|
|
||||||
"nvim-neotest/neotest",
|
|
||||||
requires = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"antoinemadec/FixCursorHold.nvim",
|
|
||||||
"nvim-neotest/neotest-go",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- get neotest namespace (api call creates or returns namespace)
|
|
||||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = {
|
|
||||||
format = function(diagnostic)
|
|
||||||
local message = diagnostic.message
|
|
||||||
:gsub("\n", " ")
|
|
||||||
:gsub("\t", " ")
|
|
||||||
:gsub("%s+", " ")
|
|
||||||
:gsub("^%s+", "")
|
|
||||||
return message
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}, neotest_ns)
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
use { "kyoh86/vim-go-coverage", opt = true, ft = "go" }
|
|
||||||
require_plugin("vim-go-coverage")
|
|
||||||
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
|
||||||
|
|
||||||
-- Sane gx for netrw_gx bug
|
|
||||||
-- use {"felipec/vim-sanegx"}
|
|
||||||
|
|
||||||
|
|
||||||
require_plugin("nvim-lspconfig")
|
|
||||||
require_plugin("lspsaga.nvim")
|
|
||||||
require_plugin("nvim-lsp-installer")
|
|
||||||
require_plugin('trouble.nvim')
|
|
||||||
require_plugin("popup.nvim")
|
|
||||||
require_plugin("plenary.nvim")
|
|
||||||
require_plugin("telescope.nvim")
|
|
||||||
require_plugin('telescope-project.nvim')
|
|
||||||
require_plugin("nvim-dap")
|
|
||||||
require_plugin("nvim-ts-autotag")
|
|
||||||
require_plugin('vim-matchup')
|
|
||||||
require_plugin("nvim-tree.lua")
|
|
||||||
require_plugin("gitsigns.nvim")
|
|
||||||
require_plugin("which-key.nvim")
|
|
||||||
require_plugin("dashboard-nvim")
|
|
||||||
require_plugin("nvim-autopairs")
|
|
||||||
require_plugin("nvim-comment")
|
|
||||||
require_plugin("nvim-bqf")
|
|
||||||
require_plugin("nvcode-color-schemes.vim")
|
|
||||||
require_plugin("nvim-web-devicons")
|
|
||||||
require_plugin("galaxyline.nvim")
|
|
||||||
require_plugin("barbar.nvim")
|
|
||||||
require_plugin('lsp-rooter.nvim')
|
|
||||||
require_plugin("nvim-ts-context-commentstring")
|
|
||||||
|
|
||||||
use { 'nvim-telescope/telescope-dap.nvim', opt = true }
|
|
||||||
require_plugin("telescope-dap.nvim")
|
|
||||||
use { 'theHamsta/nvim-dap-virtual-text', opt = true }
|
|
||||||
require_plugin("nvim-dap-virtual-text")
|
|
||||||
|
|
||||||
use { "ray-x/lsp_signature.nvim" }
|
|
||||||
use 'tanvirtin/monokai.nvim'
|
|
||||||
use 'fratajczak/one-monokai-vim'
|
|
||||||
use { "npxbr/glow.nvim", run = "GlowInstall" }
|
|
||||||
|
|
||||||
use { "akinsho/toggleterm.nvim", tag = '*', config = function()
|
|
||||||
require("toggleterm").setup()
|
|
||||||
end }
|
|
||||||
use { "Pocco81/DAPInstall.nvim", opt = true }
|
|
||||||
require_plugin("DAPInstall.nvim")
|
|
||||||
|
|
||||||
use {
|
|
||||||
'phaazon/hop.nvim',
|
|
||||||
branch = 'v1', -- optional but strongly recommended
|
|
||||||
config = function()
|
|
||||||
-- you can configure Hop the way you like here; see :h hop-config
|
|
||||||
require 'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- markdown
|
|
||||||
use { 'godlygeek/tabular' }
|
|
||||||
use { 'preservim/vim-markdown' }
|
|
||||||
use {
|
|
||||||
'iamcco/markdown-preview.nvim',
|
|
||||||
run = function() vim.fn['mkdp#util#install']() end,
|
|
||||||
ft = { 'markdown' }
|
|
||||||
}
|
|
||||||
|
|
||||||
use {'tpope/vim-fugitive'}
|
|
||||||
|
|
||||||
--use 'EdenEast/nightfox.nvim'
|
|
||||||
-- use {'godlygeek/tabular', opt=true}
|
|
||||||
-- use {'plasticboy/vim-markdown', opt=true}
|
|
||||||
-- require_plugin("tabular")
|
|
||||||
-- require_plugin("vim-markdown")
|
|
||||||
|
|
||||||
-- Extras
|
|
||||||
if O.extras then
|
|
||||||
use { 'metakirby5/codi.vim', opt = true }
|
|
||||||
require_plugin('codi.vim')
|
|
||||||
--use {'iamcco/markdown-preview.nvim', run = 'cd app && npm install', opt = true}
|
|
||||||
--require_plugin('markdown-preview.nvim')
|
|
||||||
use { 'numToStr/FTerm.nvim', opt = true }
|
|
||||||
require_plugin('FTerm.nvim')
|
|
||||||
use { 'nacro90/numb.nvim', opt = true }
|
|
||||||
require_plugin('numb.nvim')
|
|
||||||
use { 'turbio/bracey.vim', run = 'npm install --prefix server', opt = true }
|
|
||||||
require_plugin('bracey.vim')
|
|
||||||
|
|
||||||
use { 'norcalli/nvim-colorizer.lua', opt = true }
|
|
||||||
require_plugin('nvim-colorizer.lua')
|
|
||||||
use { 'nvim-treesitter/playground', opt = true }
|
|
||||||
require_plugin('playground')
|
|
||||||
-- folke/todo-comments.nvim
|
|
||||||
-- gennaro-tedesco/nvim-jqx
|
|
||||||
-- TimUntersberger/neogit
|
|
||||||
-- folke/lsp-colors.nvim
|
|
||||||
-- simrat39/symbols-outline.nvim
|
|
||||||
|
|
||||||
-- Git
|
|
||||||
-- use {'tpope/vim-rhubarb', opt = true}
|
|
||||||
-- pwntester/octo.nvim
|
|
||||||
|
|
||||||
-- Easily Create Gists
|
|
||||||
-- use {'mattn/vim-gist', opt = true}
|
|
||||||
-- use {'mattn/webapi-vim', opt = true}
|
|
||||||
end
|
|
||||||
|
|
||||||
end)
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'romgrk/barbar.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||||
|
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||||
|
},
|
||||||
|
init = function() vim.g.barbar_auto_setup = false end,
|
||||||
|
opts = {
|
||||||
|
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||||
|
-- animation = true,
|
||||||
|
-- insert_at_start = true,
|
||||||
|
-- …etc.
|
||||||
|
},
|
||||||
|
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
go = { "gofmt"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvimdev/dashboard-nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local logo = [[
|
||||||
|
|
||||||
|
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
|
||||||
|
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
|
||||||
|
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
|
||||||
|
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
|
||||||
|
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||||
|
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
|
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||||
|
opts.config.header = vim.split(logo, "\n")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {
|
||||||
|
signs = {
|
||||||
|
-- TODO add hl to colorscheme
|
||||||
|
add = {hl = 'GitSignsAdd' , text = '▎', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
||||||
|
change = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||||
|
delete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||||
|
topdelete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||||
|
changedelete = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||||
|
},
|
||||||
|
numhl = false,
|
||||||
|
linehl = false,
|
||||||
|
watch_gitdir = {
|
||||||
|
interval = 1000
|
||||||
|
},
|
||||||
|
sign_priority = 6,
|
||||||
|
update_debounce = 200,
|
||||||
|
status_formatter = nil, -- Use default
|
||||||
|
on_attach = function(buffer)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
local function map(mode, l, r, desc)
|
||||||
|
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- stylua: ignore start
|
||||||
|
map("n", "<leader>gj", gs.next_hunk, "Next Hunk")
|
||||||
|
map("n", "<leader>gh", gs.prev_hunk, "Prev Hunk")
|
||||||
|
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||||
|
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||||
|
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||||
|
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||||
|
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||||
|
map("n", "<leader>gp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||||
|
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||||
|
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||||
|
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||||
|
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"ray-x/lsp_signature.nvim",
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts) require'lsp_signature'.setup(opts) end
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvimdev/lspsaga.nvim',
|
||||||
|
config = function()
|
||||||
|
require('lspsaga').setup({})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
'nvim-tree/nvim-web-devicons' -- optional
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
vim.list_extend(opts.ensure_installed, {
|
||||||
|
"stylua",
|
||||||
|
"selene",
|
||||||
|
"luacheck",
|
||||||
|
"shellcheck",
|
||||||
|
"shfmt",
|
||||||
|
"tailwindcss-language-server",
|
||||||
|
"typescript-language-server",
|
||||||
|
"css-lsp",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
return {
|
||||||
|
{ "nvim-neotest/neotest-plenary" },
|
||||||
|
{
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
dependencies= {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"nvim-neotest/neotest-go",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
adapters = {
|
||||||
|
require("neotest-go")({
|
||||||
|
experimental = {
|
||||||
|
test_table = true,
|
||||||
|
},
|
||||||
|
args = { "-gcflags=all=-l", "-count=1", "-timeout=60s" }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
local function keymapping(cmp)
|
||||||
|
return {
|
||||||
|
-- 上一个
|
||||||
|
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||||
|
-- 下一个
|
||||||
|
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||||
|
-- 出现补全
|
||||||
|
['<A-.>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||||
|
-- 取消
|
||||||
|
['<A-,>'] = cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
}),
|
||||||
|
-- 确认
|
||||||
|
-- Accept currently selected item. If none selected, `select` first item.
|
||||||
|
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
['<CR>'] = cmp.mapping.confirm({
|
||||||
|
select = true,
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace
|
||||||
|
}),
|
||||||
|
-- ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||||
|
['<C-u>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
|
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function opts_func (_, opts)
|
||||||
|
local cmp = require("cmp")
|
||||||
|
-- Use buffer source for `/`.
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
{ name = "emoji" },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':'.
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
mapping = keymapping(cmp),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
-- For vsnip users.
|
||||||
|
{ name = 'vsnip' },
|
||||||
|
-- For luasnip users.
|
||||||
|
-- { name = 'luasnip' },
|
||||||
|
--For ultisnips users.
|
||||||
|
-- { name = 'ultisnips' },
|
||||||
|
-- -- For snippy users.
|
||||||
|
-- { name = 'snippy' },
|
||||||
|
{ name = 'emoji'}
|
||||||
|
}, { { name = 'buffer' },
|
||||||
|
{ name = 'path' }
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
-- For `vsnip` users.
|
||||||
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
|
-- -- For `luasnip` users.
|
||||||
|
-- -- require('luasnip').lsp_expand(args.body)
|
||||||
|
-- -- For `ultisnips` users.
|
||||||
|
-- -- vim.fn["UltiSnips#Anon"](args.body)
|
||||||
|
-- -- For `snippy` users.
|
||||||
|
-- -- require'snippy'.expand_snippet(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-emoji",
|
||||||
|
'hrsh7th/vim-vsnip',
|
||||||
|
'hrsh7th/vim-vsnip-integ',
|
||||||
|
},
|
||||||
|
opts = opts_func,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
return {
|
||||||
|
-- lsp servers
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
event = { 'BufReadPre', 'BufReadPost', 'BufNewFile' },
|
||||||
|
opts = {
|
||||||
|
inlay_hints = { enabled = false },
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
cssls = {},
|
||||||
|
tailwindcss = {
|
||||||
|
root_dir = function(...)
|
||||||
|
return require("lspconfig.util").root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.cjs', 'postcss.config.mjs', 'postcss.config.ts', 'package.json', 'node_modules', '.git')(...)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
tsserver = {
|
||||||
|
root_dir = function(...)
|
||||||
|
return require("lspconfig.util").root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git")(...)
|
||||||
|
end,
|
||||||
|
single_file_support = false,
|
||||||
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
inlayHints = {
|
||||||
|
includeInlayParameterNameHints = "literal",
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = false,
|
||||||
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
javascript = {
|
||||||
|
inlayHints = {
|
||||||
|
includeInlayParameterNameHints = "all",
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = true,
|
||||||
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
html = {},
|
||||||
|
yamlls = {
|
||||||
|
settings = {
|
||||||
|
yaml = {
|
||||||
|
keyOrdering = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lua_ls = {
|
||||||
|
-- enabled = false,
|
||||||
|
single_file_support = true,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
workspaceWord = true,
|
||||||
|
callSnippet = "Both",
|
||||||
|
},
|
||||||
|
misc = {
|
||||||
|
parameters = {
|
||||||
|
-- "--log-level=trace",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
hint = {
|
||||||
|
enable = true,
|
||||||
|
setType = false,
|
||||||
|
paramType = true,
|
||||||
|
paramName = "Disable",
|
||||||
|
semicolon = "Disable",
|
||||||
|
arrayIndex = "Disable",
|
||||||
|
},
|
||||||
|
doc = {
|
||||||
|
privateName = { "^_" },
|
||||||
|
},
|
||||||
|
type = {
|
||||||
|
castNumberToInteger = true,
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
disable = { "incomplete-signature-doc", "trailing-space" },
|
||||||
|
-- enable = false,
|
||||||
|
groupSeverity = {
|
||||||
|
strong = "Warning",
|
||||||
|
strict = "Warning",
|
||||||
|
},
|
||||||
|
groupFileStatus = {
|
||||||
|
["ambiguity"] = "Opened",
|
||||||
|
["await"] = "Opened",
|
||||||
|
["codestyle"] = "None",
|
||||||
|
["duplicate"] = "Opened",
|
||||||
|
["global"] = "Opened",
|
||||||
|
["luadoc"] = "Opened",
|
||||||
|
["redefined"] = "Opened",
|
||||||
|
["strict"] = "Opened",
|
||||||
|
["strong"] = "Opened",
|
||||||
|
["type-check"] = "Opened",
|
||||||
|
["unbalanced"] = "Opened",
|
||||||
|
["unused"] = "Opened",
|
||||||
|
},
|
||||||
|
unusedLocalExclude = { "_*" },
|
||||||
|
},
|
||||||
|
format = {
|
||||||
|
enable = false,
|
||||||
|
defaultConfig = {
|
||||||
|
indent_style = "space",
|
||||||
|
indent_size = "2",
|
||||||
|
continuation_indent_size = "2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
gopls = {
|
||||||
|
setup = {
|
||||||
|
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
analyses = {
|
||||||
|
nilness = true,
|
||||||
|
unusedparams = true,
|
||||||
|
unusedwrite = true,
|
||||||
|
useany = true,
|
||||||
|
},
|
||||||
|
staticcheck = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
|
||||||
|
init_options = { usePlaceholders = true, completeUnimported = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
local function my_on_attach(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
|
||||||
|
|
||||||
|
-- default mappings
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
|
|
||||||
|
-- custom mappings
|
||||||
|
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||||
|
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||||
|
vim.keymap.set('n', 'l', api.node.open.edit, opts('Edit'))
|
||||||
|
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Parent Close'))
|
||||||
|
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Horizontal Split'))
|
||||||
|
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Vertical Split'))
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
||||||
|
vim.g.nvim_tree_auto_ignore_ft = 'startify' --empty by default, don't auto open tree on specific filetypes.
|
||||||
|
|
||||||
|
vim.g.nvim_tree_icons = {
|
||||||
|
default = '',
|
||||||
|
symlink = '',
|
||||||
|
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
||||||
|
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons', -- optional
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
on_attach = my_on_attach,
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_netrw = true,
|
||||||
|
--auto_close = false,
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
custom = {}
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = false,
|
||||||
|
timeout = 500,
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
-- enables the feature
|
||||||
|
enable = true,
|
||||||
|
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
||||||
|
-- only relevant when `update_focused_file.enable` is true
|
||||||
|
update_cwd = false,
|
||||||
|
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
||||||
|
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||||
|
ignore_list = {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"simrat39/symbols-outline.nvim",
|
||||||
|
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||||
|
cmd = "SymbolsOutline",
|
||||||
|
opts = {
|
||||||
|
position = "right",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "make",
|
||||||
|
},
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>fP",
|
||||||
|
function()
|
||||||
|
require("telescope.builtin").find_files({
|
||||||
|
cwd = require("lazy.core.config").options.root,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Find Plugin File",
|
||||||
|
},
|
||||||
|
-- {
|
||||||
|
-- "<leader>sr",
|
||||||
|
-- function()
|
||||||
|
-- require("telescope.builtin").oldfiles({
|
||||||
|
-- cwd = vim.loop.cwd()
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- desc = "Find Recent File",
|
||||||
|
-- },
|
||||||
|
{
|
||||||
|
";f",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.find_files({
|
||||||
|
no_ignore = false,
|
||||||
|
hidden = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Lists files in your current working directory, respects .gitignore",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
";r",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.live_grep({
|
||||||
|
additional_args = { "--hidden" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Search for a string in your current working directory and get results live as you type, respects .gitignore",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"\\\\",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.buffers()
|
||||||
|
end,
|
||||||
|
desc = "Lists open buffers",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
";t",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.help_tags()
|
||||||
|
end,
|
||||||
|
desc = "Lists available help tags and opens a new window with the relevant help info on <cr>",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
";;",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.resume()
|
||||||
|
end,
|
||||||
|
desc = "Resume the previous telescope picker",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
";e",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.diagnostics()
|
||||||
|
end,
|
||||||
|
desc = "Lists Diagnostics for all open buffers or a specific buffer",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
";s",
|
||||||
|
function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
builtin.treesitter()
|
||||||
|
end,
|
||||||
|
desc = "Lists Function names, variables, from Treesitter",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sf",
|
||||||
|
function()
|
||||||
|
local telescope = require("telescope")
|
||||||
|
|
||||||
|
local function telescope_buffer_dir()
|
||||||
|
return vim.fn.expand("%:p:h")
|
||||||
|
end
|
||||||
|
|
||||||
|
telescope.extensions.file_browser.file_browser({
|
||||||
|
path = "%:p:h",
|
||||||
|
cwd = telescope_buffer_dir(),
|
||||||
|
respect_gitignore = false,
|
||||||
|
hidden = true,
|
||||||
|
grouped = true,
|
||||||
|
previewer = false,
|
||||||
|
initial_mode = "normal",
|
||||||
|
layout_config = { height = 40 },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Open File Browser with the path of the current buffer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local telescope = require("telescope")
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
local fb_actions = require("telescope").extensions.file_browser.actions
|
||||||
|
local trouble = require("trouble.providers.telescope")
|
||||||
|
|
||||||
|
opts.defaults = vim.tbl_deep_extend("force", opts.defaults, {
|
||||||
|
wrap_results = true,
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_config = { prompt_position = "top" },
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
winblend = 0,
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<C-c>"] = actions.close,
|
||||||
|
["<ESC>"] = actions.close,
|
||||||
|
["<C-j>"] = actions.move_selection_next,
|
||||||
|
["<C-k>"] = actions.move_selection_previous,
|
||||||
|
["<c-t>"] = trouble.open_with_trouble,
|
||||||
|
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
["<C-j>"] = actions.move_selection_next,
|
||||||
|
["<C-k>"] = actions.move_selection_previous,
|
||||||
|
["<c-t>"] = trouble.open_with_trouble,
|
||||||
|
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
opts.pickers = {
|
||||||
|
diagnostics = {
|
||||||
|
theme = "ivy",
|
||||||
|
initial_mode = "normal",
|
||||||
|
layout_config = {
|
||||||
|
preview_cutoff = 9999,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
opts.extensions = {
|
||||||
|
file_browser = {
|
||||||
|
theme = "dropdown",
|
||||||
|
-- disables netrw and use telescope-file-browser in its place
|
||||||
|
hijack_netrw = true,
|
||||||
|
mappings = {
|
||||||
|
-- your custom insert mode mappings
|
||||||
|
["n"] = {
|
||||||
|
-- your custom normal mode mappings
|
||||||
|
["N"] = fb_actions.create,
|
||||||
|
["h"] = fb_actions.goto_parent_dir,
|
||||||
|
["/"] = function()
|
||||||
|
vim.cmd("startinsert")
|
||||||
|
end,
|
||||||
|
["<C-u>"] = function(prompt_bufnr)
|
||||||
|
for i = 1, 10 do
|
||||||
|
actions.move_selection_previous(prompt_bufnr)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["<C-d>"] = function(prompt_bufnr)
|
||||||
|
for i = 1, 10 do
|
||||||
|
actions.move_selection_next(prompt_bufnr)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["<PageUp>"] = actions.preview_scrolling_up,
|
||||||
|
["<PageDown>"] = actions.preview_scrolling_down,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
telescope.setup(opts)
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
require("telescope").load_extension("file_browser")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
return {
|
||||||
|
{ "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" },
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"astro",
|
||||||
|
"cmake",
|
||||||
|
"cpp",
|
||||||
|
"css",
|
||||||
|
"fish",
|
||||||
|
"gitignore",
|
||||||
|
"go",
|
||||||
|
"graphql",
|
||||||
|
"html",
|
||||||
|
"java",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"php",
|
||||||
|
"rust",
|
||||||
|
"scss",
|
||||||
|
"sql",
|
||||||
|
"svelte",
|
||||||
|
"toml",
|
||||||
|
"tsx",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- matchup = {
|
||||||
|
-- enable = true,
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- https://github.com/nvim-treesitter/playground#query-linter
|
||||||
|
query_linter = {
|
||||||
|
enable = true,
|
||||||
|
use_virtual_text = true,
|
||||||
|
lint_events = { "BufWrite", "CursorHold" },
|
||||||
|
},
|
||||||
|
|
||||||
|
playground = {
|
||||||
|
enable = true,
|
||||||
|
disable = {},
|
||||||
|
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
|
||||||
|
persist_queries = true, -- Whether the query persists across vim sessions
|
||||||
|
keybindings = {
|
||||||
|
toggle_query_editor = "o",
|
||||||
|
toggle_hl_groups = "i",
|
||||||
|
toggle_injected_languages = "t",
|
||||||
|
toggle_anonymous_nodes = "a",
|
||||||
|
toggle_language_display = "I",
|
||||||
|
focus_language = "f",
|
||||||
|
unfocus_language = "F",
|
||||||
|
update = "R",
|
||||||
|
goto_node = "<cr>",
|
||||||
|
show_help = "?",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
|
||||||
|
-- MDX
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
mdx = "mdx",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.treesitter.language.register("markdown", "mdx")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object"
|
|
||||||
vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|.
|
|
||||||
vim.cmd('set inccommand=split') -- Make substitution work in realtime
|
|
||||||
vim.o.hidden = true -- Required to keep multiple buffers open multiple buffers
|
|
||||||
vim.o.title = true
|
|
||||||
TERMINAL = vim.fn.expand('$TERMINAL')
|
|
||||||
vim.cmd('let &titleold="'..TERMINAL..'"')
|
|
||||||
vim.o.titlestring="%<%F%=%l/%L - nvim"
|
|
||||||
vim.wo.wrap = true -- Display long lines as just one line
|
|
||||||
vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
|
|
||||||
vim.cmd('syntax on') -- syntax highlighting
|
|
||||||
vim.o.pumheight = 10 -- Makes popup menu smaller
|
|
||||||
vim.o.fileencoding = "utf-8" -- The encoding written to file
|
|
||||||
vim.o.cmdheight = 2 -- More space for displaying messages
|
|
||||||
vim.cmd('set colorcolumn=99999') -- fix indentline for now
|
|
||||||
vim.o.mouse = "a" -- Enable your mouse
|
|
||||||
vim.o.splitbelow = true -- Horizontal splits will automatically be below
|
|
||||||
vim.o.termguicolors = true -- set term gui colors most terminals support this
|
|
||||||
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
|
||||||
-- vim.o.t_Co = "256" -- Support 256 colors
|
|
||||||
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
|
||||||
-- vim.cmd('set ts=4') -- Insert 2 spaces for a tab
|
|
||||||
-- vim.cmd('set sw=4') -- Change the number of space characters inserted for indentation
|
|
||||||
-- vim.cmd('set expandtab') -- Converts tabs to spaces
|
|
||||||
vim.bo.smartindent = true -- Makes indenting smart
|
|
||||||
vim.wo.number = true -- set numbered lines
|
|
||||||
vim.wo.relativenumber = true -- set relative number
|
|
||||||
vim.wo.cursorline = true -- Enable highlighting of the current line
|
|
||||||
vim.o.showtabline = 2 -- Always show tabs
|
|
||||||
vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
|
||||||
vim.o.backup = false -- This is recommended by coc
|
|
||||||
vim.o.writebackup = false -- This is recommended by coc
|
|
||||||
vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
|
||||||
vim.o.updatetime = 300 -- Faster completion
|
|
||||||
vim.o.timeoutlen = 100 -- By default timeoutlen is 1000 ms
|
|
||||||
vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else
|
|
||||||
vim.cmd('filetype plugin on') -- filetype detection
|
|
||||||
-- vim.o.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18"
|
|
||||||
-- vim.o.guifont = "Hack\\ Nerd\\ Font\\ Mono"
|
|
||||||
-- vim.o.guifont = "SauceCodePro Nerd Font:h17"
|
|
||||||
vim.o.guifont = "FiraCode Nerd Font:h17"
|
|
||||||
|
|
||||||
-- vim.o.guifont = "JetBrains\\ Mono\\ Regular\\ Nerd\\ Font\\ Complete"
|
|
||||||
|
|
||||||
vim.g.vimspector_enable_mappings = 'HUMAN'
|
|
||||||
vim.g['test#go#rspec#options'] = { nearest= '--v', suite= '--v' }
|
|
||||||
vim.o.background = "dark"
|
|
||||||
--require('monokai')
|
|
||||||
--vim.cmd('colorscheme monokai_pro')
|
|
||||||
--require('nightfox').set()
|
|
||||||
--vim.cmd('colorscheme one-monokai')
|
|
||||||
--vim.cmd([[colorscheme gruvbox]])
|
|
||||||
|
|
||||||
-- git blame
|
|
||||||
vim.cmd('highlight default link gitblame SpecialComment')
|
|
||||||
vim.g.gitblame_enabled = 0
|
|
||||||
|
|
||||||
-- last position jump
|
|
||||||
vim.cmd([[
|
|
||||||
autocmd BufReadPost * if line("'\"") >= 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
|
||||||
]])
|
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
-- selene: allow(global_usage)
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.get_loc()
|
||||||
|
local me = debug.getinfo(1, "S")
|
||||||
|
local level = 2
|
||||||
|
local info = debug.getinfo(level, "S")
|
||||||
|
while info and (info.source == me.source or info.source == "@" .. vim.env.MYVIMRC or info.what ~= "Lua") do
|
||||||
|
level = level + 1
|
||||||
|
info = debug.getinfo(level, "S")
|
||||||
|
end
|
||||||
|
info = info or me
|
||||||
|
local source = info.source:sub(2)
|
||||||
|
source = vim.loop.fs_realpath(source) or source
|
||||||
|
return source .. ":" .. info.linedefined
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param value any
|
||||||
|
---@param opts? {loc:string}
|
||||||
|
function M._dump(value, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.loc = opts.loc or M.get_loc()
|
||||||
|
if vim.in_fast_event() then
|
||||||
|
return vim.schedule(function()
|
||||||
|
M._dump(value, opts)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
opts.loc = vim.fn.fnamemodify(opts.loc, ":~:.")
|
||||||
|
local msg = vim.inspect(value)
|
||||||
|
vim.notify(msg, vim.log.levels.INFO, {
|
||||||
|
title = "Debug: " .. opts.loc,
|
||||||
|
on_open = function(win)
|
||||||
|
vim.wo[win].conceallevel = 3
|
||||||
|
vim.wo[win].concealcursor = ""
|
||||||
|
vim.wo[win].spell = false
|
||||||
|
local buf = vim.api.nvim_win_get_buf(win)
|
||||||
|
if not pcall(vim.treesitter.start, buf, "lua") then
|
||||||
|
vim.bo[buf].filetype = "lua"
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.dump(...)
|
||||||
|
local value = { ... }
|
||||||
|
if vim.tbl_isempty(value) then
|
||||||
|
value = nil
|
||||||
|
else
|
||||||
|
value = vim.tbl_islist(value) and vim.tbl_count(value) <= 1 and value[1] or value
|
||||||
|
end
|
||||||
|
M._dump(value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.extmark_leaks()
|
||||||
|
local nsn = vim.api.nvim_get_namespaces()
|
||||||
|
|
||||||
|
local counts = {}
|
||||||
|
|
||||||
|
for name, ns in pairs(nsn) do
|
||||||
|
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
|
local count = #vim.api.nvim_buf_get_extmarks(buf, ns, 0, -1, {})
|
||||||
|
if count > 0 then
|
||||||
|
counts[#counts + 1] = {
|
||||||
|
name = name,
|
||||||
|
buf = buf,
|
||||||
|
count = count,
|
||||||
|
ft = vim.bo[buf].ft,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.sort(counts, function(a, b)
|
||||||
|
return a.count > b.count
|
||||||
|
end)
|
||||||
|
dd(counts)
|
||||||
|
end
|
||||||
|
|
||||||
|
function estimateSize(value, visited)
|
||||||
|
if value == nil then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
local bytes = 0
|
||||||
|
|
||||||
|
-- initialize the visited table if not already done
|
||||||
|
--- @type table<any, true>
|
||||||
|
visited = visited or {}
|
||||||
|
|
||||||
|
-- handle already-visited value to avoid infinite recursion
|
||||||
|
if visited[value] then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
visited[value] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if type(value) == "boolean" or value == nil then
|
||||||
|
bytes = 4
|
||||||
|
elseif type(value) == "number" then
|
||||||
|
bytes = 8
|
||||||
|
elseif type(value) == "string" then
|
||||||
|
bytes = string.len(value) + 24
|
||||||
|
elseif type(value) == "function" then
|
||||||
|
bytes = 32 -- base size for a function
|
||||||
|
-- add size of upvalues
|
||||||
|
local i = 1
|
||||||
|
while true do
|
||||||
|
local name, val = debug.getupvalue(value, i)
|
||||||
|
if not name then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
bytes = bytes + estimateSize(val, visited)
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
elseif type(value) == "table" then
|
||||||
|
bytes = 40 -- base size for a table entry
|
||||||
|
for k, v in pairs(value) do
|
||||||
|
bytes = bytes + estimateSize(k, visited) + estimateSize(v, visited)
|
||||||
|
end
|
||||||
|
local mt = debug.getmetatable(value)
|
||||||
|
if mt then
|
||||||
|
bytes = bytes + estimateSize(mt, visited)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return bytes
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.module_leaks(filter)
|
||||||
|
local sizes = {}
|
||||||
|
for modname, mod in pairs(package.loaded) do
|
||||||
|
if not filter or modname:match(filter) then
|
||||||
|
local root = modname:match("^([^%.]+)%..*$") or modname
|
||||||
|
-- root = modname
|
||||||
|
sizes[root] = sizes[root] or { mod = root, size = 0 }
|
||||||
|
sizes[root].size = sizes[root].size + estimateSize(mod) / 1024 / 1024
|
||||||
|
end
|
||||||
|
end
|
||||||
|
sizes = vim.tbl_values(sizes)
|
||||||
|
table.sort(sizes, function(a, b)
|
||||||
|
return a.size > b.size
|
||||||
|
end)
|
||||||
|
dd(sizes)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.get_upvalue(func, name)
|
||||||
|
local i = 1
|
||||||
|
while true do
|
||||||
|
local n, v = debug.getupvalue(func, i)
|
||||||
|
if not n then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if n == name then
|
||||||
|
return v
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -19,7 +19,7 @@ end
|
|||||||
|
|
||||||
function lv_utils.open_md()
|
function lv_utils.open_md()
|
||||||
local p = vim.fn.expand('%:p')
|
local p = vim.fn.expand('%:p')
|
||||||
vim.fn.system("open -a typora "..p)
|
vim.fn.system("open -a marktext "..p)
|
||||||
end
|
end
|
||||||
|
|
||||||
function lv_utils.define_augroups(definitions) -- {{{1
|
function lv_utils.define_augroups(definitions) -- {{{1
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
--[[
|
|
||||||
O is the global options object
|
|
||||||
|
|
||||||
Formatters and linters should be
|
|
||||||
filled in as strings with either
|
|
||||||
a global executable or a path to
|
|
||||||
an executable
|
|
||||||
]]
|
|
||||||
|
|
||||||
-- general
|
|
||||||
O.auto_complete = true
|
|
||||||
O.colorscheme = 'lunar'
|
|
||||||
O.auto_close_tree = 0
|
|
||||||
O.wrap_lines = false
|
|
||||||
O.timeoutlen = 100
|
|
||||||
O.document_highlight = true
|
|
||||||
O.extras = true
|
|
||||||
|
|
||||||
-- dashboard
|
|
||||||
-- O.dashboard.custom_header = {""}
|
|
||||||
-- O.dashboard.footer = {""}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
O.clang.diagnostics.virtual_text = false
|
|
||||||
O.clang.diagnostics.signs = false
|
|
||||||
O.clang.diagnostics.underline = false
|
|
||||||
|
|
||||||
-- python
|
|
||||||
-- add things like O.python.formatter.yapf.exec_path
|
|
||||||
-- add things like O.python.linter.flake8.exec_path
|
|
||||||
-- add things like O.python.formatter.isort.exec_path
|
|
||||||
O.python.formatter = 'yapf'
|
|
||||||
-- O.python.linter = 'flake8'
|
|
||||||
O.python.isort = true
|
|
||||||
O.python.autoformat = true
|
|
||||||
O.python.diagnostics.virtual_text = true
|
|
||||||
O.python.diagnostics.signs = true
|
|
||||||
O.python.diagnostics.underline = true
|
|
||||||
O.python.analysis.type_checking = "off"
|
|
||||||
O.python.analysis.auto_search_paths = true
|
|
||||||
O.python.analysis.use_library_code_types = true
|
|
||||||
|
|
||||||
-- lua
|
|
||||||
-- TODO look into stylua
|
|
||||||
O.lua.formatter = 'lua-format'
|
|
||||||
-- O.lua.formatter = 'lua-format'
|
|
||||||
--O.lua.autoformat = false
|
|
||||||
|
|
||||||
-- javascript
|
|
||||||
O.tsserver.formatter = 'prettier'
|
|
||||||
O.tsserver.linter = nil
|
|
||||||
O.tsserver.autoformat = true
|
|
||||||
|
|
||||||
-- json
|
|
||||||
O.json.autoformat = true
|
|
||||||
|
|
||||||
-- ruby
|
|
||||||
O.ruby.autoformat = true
|
|
||||||
|
|
||||||
-- go
|
|
||||||
O.go.autoformat = true
|
|
||||||
-- create custom autocommand field (This would be easy with lua)
|
|
||||||
|
|
||||||
-- Turn off relative_numbers
|
|
||||||
-- O.relative_number = false
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
!#/bin/bash
|
|
||||||
cd ~
|
|
||||||
sudo rm -r neovim
|
|
||||||
git clone https://github.com/neovim/neovim
|
|
||||||
cd neovim
|
|
||||||
sudo make CMAKE_BUILD_TYPE=Release install
|
|
||||||
cd ~
|
|
||||||
sudo rm -r neovim
|
|
||||||
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# NOTE:
|
|
||||||
# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead
|
|
||||||
#
|
|
||||||
# NOTE:
|
|
||||||
# If you're not using Linux you'll need to adjust the `-configuration` option
|
|
||||||
# to point to the `config_mac' or `config_win` folders depending on your system.
|
|
||||||
|
|
||||||
JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar"
|
|
||||||
GRADLE_HOME=$HOME/gradle $HOME/.sdkman/candidates/java/current/bin/java \
|
|
||||||
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
|
|
||||||
-Dosgi.bundles.defaultStartLevel=4 \
|
|
||||||
-Declipse.product=org.eclipse.jdt.ls.core.product \
|
|
||||||
-Dlog.protocol=true \
|
|
||||||
-Dlog.level=ALL \
|
|
||||||
-javaagent:/usr/local/share/lombok/lombok.jar \
|
|
||||||
-Xms1g \
|
|
||||||
-Xmx2G \
|
|
||||||
-jar $(echo "$JAR") \
|
|
||||||
-configuration "$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_linux" \
|
|
||||||
-data "${1:-$HOME/workspace}" \
|
|
||||||
--add-modules=ALL-SYSTEM \
|
|
||||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
|
||||||
--add-opens java.base/java.lang=ALL-UNNAMED
|
|
||||||
|
|
||||||
# for older java versions if you wanna use lombok
|
|
||||||
# -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# NOTE:
|
|
||||||
# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead
|
|
||||||
#
|
|
||||||
# NOTE:
|
|
||||||
# If you're not using Linux you'll need to adjust the `-configuration` option
|
|
||||||
# to point to the `config_mac' or `config_win` folders depending on your system.
|
|
||||||
|
|
||||||
JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar"
|
|
||||||
GRADLE_HOME=$HOME/gradle $HOME/.sdkman/candidates/java/current/bin/java \
|
|
||||||
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
|
|
||||||
-Dosgi.bundles.defaultStartLevel=4 \
|
|
||||||
-Declipse.product=org.eclipse.jdt.ls.core.product \
|
|
||||||
-Dlog.protocol=true \
|
|
||||||
-Dlog.level=ALL \
|
|
||||||
-javaagent:/usr/local/share/lombok/lombok.jar \
|
|
||||||
-Xms1g \
|
|
||||||
-Xmx2G \
|
|
||||||
-jar $(echo "$JAR") \
|
|
||||||
-configuration "$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_mac" \
|
|
||||||
-data "${1:-$HOME/workspace}" \
|
|
||||||
--add-modules=ALL-SYSTEM \
|
|
||||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
|
||||||
--add-opens java.base/java.lang=ALL-UNNAMED
|
|
||||||
|
|
||||||
# for older java versions if you wanna use lombok
|
|
||||||
# -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
nvim -u ~/.config/nvcode/init.lua
|
|
||||||
@@ -1,207 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -o nounset # error when referencing undefined variable
|
|
||||||
set -o errexit # exit when command fails
|
|
||||||
|
|
||||||
installnodemac() {
|
|
||||||
brew install lua
|
|
||||||
brew install node
|
|
||||||
brew install yarn
|
|
||||||
}
|
|
||||||
|
|
||||||
installnodeubuntu() {
|
|
||||||
sudo apt install nodejs
|
|
||||||
sudo apt install npm
|
|
||||||
}
|
|
||||||
|
|
||||||
moveoldnvim() {
|
|
||||||
echo "Not installing LunarVim"
|
|
||||||
echo "Please move your ~/.config/nvim folder before installing"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
installnodearch() {
|
|
||||||
sudo pacman -S nodejs
|
|
||||||
sudo pacman -S npm
|
|
||||||
}
|
|
||||||
|
|
||||||
installnodefedora() {
|
|
||||||
sudo dnf install -y nodejs
|
|
||||||
sudo dnf install -y npm
|
|
||||||
}
|
|
||||||
|
|
||||||
installnodegentoo() {
|
|
||||||
echo "Printing current node status..."
|
|
||||||
emerge -pqv net-libs/nodejs
|
|
||||||
echo "Make sure the npm USE flag is enabled for net-libs/nodejs"
|
|
||||||
echo "If it isn't enabled, would you like to enable it with flaggie? (Y/N)"
|
|
||||||
read answer
|
|
||||||
[ "$answer" != "${answer#[Yy]}" ] && sudo flaggie net-libs/nodejs +npm
|
|
||||||
sudo emerge -avnN net-libs/nodejs
|
|
||||||
}
|
|
||||||
|
|
||||||
installnode() {
|
|
||||||
echo "Installing node..."
|
|
||||||
[ "$(uname)" == "Darwin" ] && installnodemac
|
|
||||||
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installnodeubuntu
|
|
||||||
[ -f "/etc/arch-release" ] && installnodearch
|
|
||||||
[ -f "/etc/artix-release" ] && installnodearch
|
|
||||||
[ -f "/etc/fedora-release" ] && installnodefedora
|
|
||||||
[ -f "/etc/gentoo-release" ] && installnodegentoo
|
|
||||||
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
|
|
||||||
sudo npm i -g neovim
|
|
||||||
}
|
|
||||||
|
|
||||||
installpiponmac() {
|
|
||||||
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
|
||||||
python3 get-pip.py
|
|
||||||
rm get-pip.py
|
|
||||||
}
|
|
||||||
|
|
||||||
installpiponubuntu() {
|
|
||||||
sudo apt install python3-pip >/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
installpiponarch() {
|
|
||||||
sudo pacman -S python-pip
|
|
||||||
}
|
|
||||||
|
|
||||||
installpiponfedora() {
|
|
||||||
sudo dnf install -y pip >/dev/nul
|
|
||||||
}
|
|
||||||
|
|
||||||
installpipongentoo() {
|
|
||||||
sudo emerge -avn dev-python/pip
|
|
||||||
}
|
|
||||||
|
|
||||||
installpip() {
|
|
||||||
echo "Installing pip..."
|
|
||||||
[ "$(uname)" == "Darwin" ] && installpiponmac
|
|
||||||
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installpiponubuntu
|
|
||||||
[ -f "/etc/arch-release" ] && installpiponarch
|
|
||||||
[ -f "/etc/fedora-release" ] && installpiponfedora
|
|
||||||
[ -f "/etc/gentoo-release" ] && installpipongentoo
|
|
||||||
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
|
|
||||||
}
|
|
||||||
|
|
||||||
installpynvim() {
|
|
||||||
echo "Installing pynvim..."
|
|
||||||
if [ -f "/etc/gentoo-release" ]; then
|
|
||||||
echo "Installing using Portage"
|
|
||||||
sudo emerge -avn dev-python/pynvim
|
|
||||||
else
|
|
||||||
pip3 install pynvim --user
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installpacker() {
|
|
||||||
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
||||||
}
|
|
||||||
|
|
||||||
cloneconfig() {
|
|
||||||
echo "Cloning LunarVim configuration"
|
|
||||||
git clone https://github.com/ChristianChiarulli/lunarvim.git ~/.config/nvim
|
|
||||||
# mv $HOME/.config/nvim/init.lua $HOME/.config/nvim/init.lua.tmp
|
|
||||||
# mv $HOME/.config/nvim/utils/init.lua $HOME/.config/nvim/init.lua
|
|
||||||
nvim -u $HOME/.config/nvim/init.lua +PackerInstall
|
|
||||||
# rm $HOME/.config/nvim/init.lua
|
|
||||||
# mv $HOME/.config/nvim/init.lua.tmp $HOME/.config/nvim/init.lua
|
|
||||||
}
|
|
||||||
|
|
||||||
asktoinstallnode() {
|
|
||||||
echo "node not found"
|
|
||||||
echo -n "Would you like to install node now (y/n)? "
|
|
||||||
read answer
|
|
||||||
[ "$answer" != "${answer#[Yy]}" ] && installnode
|
|
||||||
}
|
|
||||||
|
|
||||||
asktoinstallpip() {
|
|
||||||
# echo "pip not found"
|
|
||||||
# echo -n "Would you like to install pip now (y/n)? "
|
|
||||||
# read answer
|
|
||||||
# [ "$answer" != "${answer#[Yy]}" ] && installpip
|
|
||||||
echo "Please install pip3 before continuing with install"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
installonmac() {
|
|
||||||
brew install ripgrep fzf ranger
|
|
||||||
npm install -g tree-sitter-cli
|
|
||||||
}
|
|
||||||
|
|
||||||
pipinstallueberzug() {
|
|
||||||
which pip3 >/dev/null && pip3 install ueberzug || echo "Not installing ueberzug pip not found"
|
|
||||||
}
|
|
||||||
|
|
||||||
installonubuntu() {
|
|
||||||
sudo apt install ripgrep fzf ranger
|
|
||||||
sudo apt install libjpeg8-dev zlib1g-dev python-dev python3-dev libxtst-dev
|
|
||||||
pip3 install ueberzug
|
|
||||||
pip3 install neovim-remote
|
|
||||||
npm install -g tree-sitter-cli
|
|
||||||
}
|
|
||||||
|
|
||||||
installonarch() {
|
|
||||||
sudo pacman -S ripgrep fzf ranger
|
|
||||||
which yay >/dev/null && yay -S python-ueberzug-git || pipinstallueberzug
|
|
||||||
pip3 install neovim-remote
|
|
||||||
npm install -g tree-sitter-cli
|
|
||||||
}
|
|
||||||
|
|
||||||
installonfedora() {
|
|
||||||
sudo dnf groupinstall "X Software Development"
|
|
||||||
sudo dnf install -y fzf ripgrep ranger
|
|
||||||
pip3 install wheel ueberzug
|
|
||||||
}
|
|
||||||
|
|
||||||
installongentoo() {
|
|
||||||
sudo emerge -avn sys-apps/ripgrep app-shells/fzf app-misc/ranger dev-python/neovim-remote virtual/jpeg sys-libs/zlib
|
|
||||||
pipinstallueberzug
|
|
||||||
npm install -g tree-sitter-cli
|
|
||||||
}
|
|
||||||
|
|
||||||
installextrapackages() {
|
|
||||||
[ "$(uname)" == "Darwin" ] && installonmac
|
|
||||||
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installonubuntu
|
|
||||||
[ -f "/etc/arch-release" ] && installonarch
|
|
||||||
[ -f "/etc/artix-release" ] && installonarch
|
|
||||||
[ -f "/etc/fedora-release" ] && installonfedora
|
|
||||||
[ -f "/etc/gentoo-release" ] && installongentoo
|
|
||||||
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Welcome
|
|
||||||
echo 'Installing LunarVim'
|
|
||||||
|
|
||||||
# move old nvim directory if it exists
|
|
||||||
[ -d "$HOME/.config/nvim" ] && moveoldnvim
|
|
||||||
|
|
||||||
# install pip
|
|
||||||
which pip3 >/dev/null && echo "pip installed, moving on..." || asktoinstallpip
|
|
||||||
|
|
||||||
# install node and neovim support
|
|
||||||
which node >/dev/null && echo "node installed, moving on..." || asktoinstallnode
|
|
||||||
|
|
||||||
# install pynvim
|
|
||||||
pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on..." || installpynvim
|
|
||||||
|
|
||||||
if [ -e "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then
|
|
||||||
echo 'packer already installed'
|
|
||||||
else
|
|
||||||
installpacker
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "$HOME/.config/nvim/init.lua" ]; then
|
|
||||||
echo 'nvcode already installed'
|
|
||||||
else
|
|
||||||
# clone config down
|
|
||||||
cloneconfig
|
|
||||||
# echo 'export PATH=$HOME/.config/nvim/utils/bin:$PATH' >>~/.zshrc
|
|
||||||
# echo 'export PATH=$HOME/.config/nvcode/utils/bin:$PATH' >>~/.bashrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts"
|
|
||||||
|
|
||||||
# echo "I also recommend you add 'set preview_images_method ueberzug' to ~/.config/ranger/rc.conf"
|
|
||||||
|
|
||||||
# echo 'export PATH=/home/$USER/.config/nvcode/utils/bin:$PATH appending to zshrc/bashrc'
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 856 KiB |
@@ -1,171 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"key": "shift+ctrl+e",
|
|
||||||
"command": "actions.findWithSelection"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+e",
|
|
||||||
"command": "-actions.findWithSelection"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+e",
|
|
||||||
"command": "workbench.view.explorer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+ctrl+e",
|
|
||||||
"command": "-workbench.view.explorer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "r",
|
|
||||||
"command": "renameFile",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "enter",
|
|
||||||
"command": "-renameFile",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "j",
|
|
||||||
"command": "list.focusDown",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "k",
|
|
||||||
"command": "list.focusUp",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+j",
|
|
||||||
"command": "selectNextSuggestion",
|
|
||||||
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+k",
|
|
||||||
"command": "selectPrevSuggestion",
|
|
||||||
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+j",
|
|
||||||
"command": "workbench.action.quickOpenNavigateNext",
|
|
||||||
"when": "inQuickOpen"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "tab",
|
|
||||||
"command": "selectNextSuggestion",
|
|
||||||
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "tab",
|
|
||||||
"command": "workbench.action.quickOpenNavigateNext",
|
|
||||||
"when": "inQuickOpen"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+tab",
|
|
||||||
"command": "selectPrevSuggestion",
|
|
||||||
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+tab",
|
|
||||||
"command": "workbench.action.quickOpenNavigatePrevious",
|
|
||||||
"when": "inQuickOpen"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+k",
|
|
||||||
"command": "workbench.action.quickOpenNavigatePrevious",
|
|
||||||
"when": "inQuickOpen"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "enter",
|
|
||||||
"command": "list.select",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "l",
|
|
||||||
"command": "list.select",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "o",
|
|
||||||
"command": "list.toggleExpand",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "h",
|
|
||||||
"command": "list.collapse",
|
|
||||||
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "a",
|
|
||||||
"command": "explorer.newFile",
|
|
||||||
"when": "filesExplorerFocus && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+a",
|
|
||||||
"command": "explorer.newFolder",
|
|
||||||
"when": "filesExplorerFocus && !inputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+;",
|
|
||||||
"command": "insertPrevSuggestion",
|
|
||||||
"when": "hasOtherSuggestions && textInputFocus && textInputFocus && !inSnippetMode && !suggestWidgetVisible && config.editor.tabCompletion == 'on'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+l",
|
|
||||||
"when": "sideBarFocus",
|
|
||||||
"command": "workbench.action.focusActiveEditorGroup"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+k",
|
|
||||||
"command": "workbench.action.focusActiveEditorGroup",
|
|
||||||
"when": "terminalFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+shift+t",
|
|
||||||
"command": "workbench.action.terminal.focus",
|
|
||||||
"when": "!terminalFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+j",
|
|
||||||
"command": "-editor.action.insertLineAfter",
|
|
||||||
"when": "editorTextFocus && neovim.ctrlKeysInsert && !neovim.recording && neovim.mode == 'insert'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "alt+j",
|
|
||||||
"command": "workbench.action.terminal.focus",
|
|
||||||
"when": "!terminalFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+shift+t",
|
|
||||||
"command": "workbench.action.togglePanel"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+j",
|
|
||||||
"command": "-workbench.action.togglePanel"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+k",
|
|
||||||
"command": "editor.action.showHover",
|
|
||||||
"when": "editorTextFocus && neovim.mode != 'insert'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+k ctrl+i",
|
|
||||||
"command": "-editor.action.showHover",
|
|
||||||
"when": "editorTextFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "shift+tab",
|
|
||||||
"command": "-acceptAlternativeSelectedSuggestion",
|
|
||||||
"when": "suggestWidgetVisible && textInputFocus && textInputFocus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ctrl+f",
|
|
||||||
"command": "-vscode-neovim.ctrl-f",
|
|
||||||
"when": "editorTextFocus && neovim.ctrlKeysNormal && neovim.init && neovim.mode != 'insert'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "space",
|
|
||||||
"command": "whichkey.show",
|
|
||||||
"when": "neovim.mode != 'insert'"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,73 +0,0 @@
|
|||||||
command! LspCodeAction lua require 'lv-utils'.code_action()
|
|
||||||
command! LspDeclaration lua require 'lv-utils'.declaration()
|
|
||||||
command! LspDefinition lua require 'lv-utils'.definition()
|
|
||||||
command! LspDocumentSymbol lua require 'lv-utils'.document_symbol()
|
|
||||||
command! LspFormatting lua require 'lv-utils'.formatting()
|
|
||||||
command! LspFormattingSync lua require 'lv-utils'.formatting_sync()
|
|
||||||
command! LspHover lua require 'lv-utils'.hover()
|
|
||||||
command! LspImplementation lua require 'lv-utils'.implementation()
|
|
||||||
command! LspRangeCodeAction lua require 'lv-utils'.range_code_action()
|
|
||||||
command! LspRangeFormatting lua require 'lv-utils'.range_formatting()
|
|
||||||
command! LspReferences lua require 'lv-utils'.references()
|
|
||||||
command! LspRename lua require 'lv-utils'.rename()
|
|
||||||
command! LspTypeDefinition lua require 'lv-utils'.type_definition()
|
|
||||||
command! LspWorkspaceSymbol lua require 'lv-utils'.workspace_symbol()
|
|
||||||
command! LspGotoNext lua require 'lv-utils'.goto_next()
|
|
||||||
command! LspGotoPrev lua require 'lv-utils'.goto_prev()
|
|
||||||
command! LspShowLineDiagnostics lua require 'lv-utils'.show_line_diagnostics()
|
|
||||||
command! NextHunk lua require 'lv-utils'.next_hunk()
|
|
||||||
command! PrevHunk lua require 'lv-utils'.prev_hunk()
|
|
||||||
command! StageHunk lua require 'lv-utils'.stage_hunk()
|
|
||||||
command! UndoStageHunk lua require 'lv-utils'.undo_stage_hunk()
|
|
||||||
command! ResetHunk lua require 'lv-utils'.reset_hunk()
|
|
||||||
command! ResetBuffer lua require 'lv-utils'.reset_buffer()
|
|
||||||
command! PreviewHunk lua require 'lv-utils'.preview_hunk()
|
|
||||||
command! BlameLine lua require 'lv-utils'.blame_line()
|
|
||||||
command! W noa w
|
|
||||||
|
|
||||||
" Debugging
|
|
||||||
command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint()
|
|
||||||
command! DebugStart lua require'dap'.continue()
|
|
||||||
command! DebugContinue lua require'dap'.continue()
|
|
||||||
command! DebugStepOver lua require'dap'.step_over()
|
|
||||||
command! DebugStepOut lua require'dap'.step_out()
|
|
||||||
command! DebugStepInto lua require'dap'.step_into()
|
|
||||||
command! DebugToggleRepl lua require'dap'.repl.toggle()
|
|
||||||
command! DebugGetSession lua require'dap'.session()
|
|
||||||
|
|
||||||
" Available Debug Adapters:
|
|
||||||
" https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
|
|
||||||
"
|
|
||||||
" Adapter configuration and installation instructions:
|
|
||||||
" https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
|
|
||||||
"
|
|
||||||
" Debug Adapter protocol:
|
|
||||||
" https://microsoft.github.io/debug-adapter-protocol/
|
|
||||||
|
|
||||||
" TODO Add full support later
|
|
||||||
" nnoremap <silent> <F5> :lua require'dap'.continue()<CR>
|
|
||||||
" nnoremap <silent> <F10> :lua require'dap'.step_over()<CR>
|
|
||||||
" nnoremap <silent> <F11> :lua require'dap'.step_into()<CR>
|
|
||||||
" nnoremap <silent> <F12> :lua require'dap'.step_out()<CR>
|
|
||||||
" nnoremap <silent> <leader>b :lua require'dap'.toggle_breakpoint()<CR>
|
|
||||||
" nnoremap <silent> <leader>B :lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>
|
|
||||||
" nnoremap <silent> <leader>lp :lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>
|
|
||||||
" nnoremap <silent> <leader>dr :lua require'dap'.repl.open()<CR>
|
|
||||||
" nnoremap <silent> <leader>dl :lua require'dap'.run_last()<CR>
|
|
||||||
|
|
||||||
autocmd! User GoyoEnter lua require('gitsigns').toggle_signs()
|
|
||||||
autocmd! User GoyoLeave lua require('gitsigns').toggle_signs()
|
|
||||||
|
|
||||||
autocmd User GoyoEnter set laststatus=0
|
|
||||||
autocmd User GoyoLeave set laststatus=2
|
|
||||||
|
|
||||||
" autocmd! User GoyoEnter lua require('galaxyline').disable_galaxyline()
|
|
||||||
" autocmd! User GoyoLeave lua require('galaxyline').galaxyline_augroup()
|
|
||||||
|
|
||||||
function! QuickFixToggle()
|
|
||||||
if empty(filter(getwininfo(), 'v:val.quickfix'))
|
|
||||||
copen
|
|
||||||
else
|
|
||||||
cclose
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
" packadd quickscope
|
|
||||||
|
|
||||||
execute 'luafile ' . stdpath('config') . '/lua/settings.lua'
|
|
||||||
|
|
||||||
function! s:manageEditorSize(...)
|
|
||||||
let count = a:1
|
|
||||||
let to = a:2
|
|
||||||
for i in range(1, count ? count : 1)
|
|
||||||
call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize')
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:vscodeCommentary(...) abort
|
|
||||||
if !a:0
|
|
||||||
let &operatorfunc = matchstr(expand('<sfile>'), '[^. ]*$')
|
|
||||||
return 'g@'
|
|
||||||
elseif a:0 > 1
|
|
||||||
let [line1, line2] = [a:1, a:2]
|
|
||||||
else
|
|
||||||
let [line1, line2] = [line("'["), line("']")]
|
|
||||||
endif
|
|
||||||
|
|
||||||
call VSCodeCallRange("editor.action.commentLine", line1, line2, 0)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:openVSCodeCommandsInVisualMode()
|
|
||||||
normal! gv
|
|
||||||
let visualmode = visualmode()
|
|
||||||
if visualmode == "V"
|
|
||||||
let startLine = line("v")
|
|
||||||
let endLine = line(".")
|
|
||||||
call VSCodeNotifyRange("workbench.action.showCommands", startLine, endLine, 1)
|
|
||||||
else
|
|
||||||
let startPos = getpos("v")
|
|
||||||
let endPos = getpos(".")
|
|
||||||
call VSCodeNotifyRangePos("workbench.action.showCommands", startPos[1], endPos[1], startPos[2], endPos[2], 1)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:openWhichKeyInVisualMode()
|
|
||||||
normal! gv
|
|
||||||
let visualmode = visualmode()
|
|
||||||
if visualmode == "V"
|
|
||||||
let startLine = line("v")
|
|
||||||
let endLine = line(".")
|
|
||||||
call VSCodeNotifyRange("whichkey.show", startLine, endLine, 1)
|
|
||||||
else
|
|
||||||
let startPos = getpos("v")
|
|
||||||
let endPos = getpos(".")
|
|
||||||
call VSCodeNotifyRangePos("whichkey.show", startPos[1], endPos[1], startPos[2], endPos[2], 1)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Better Navigation
|
|
||||||
nnoremap <silent> <C-j> :call VSCodeNotify('workbench.action.navigateDown')<CR>
|
|
||||||
xnoremap <silent> <C-j> :call VSCodeNotify('workbench.action.navigateDown')<CR>
|
|
||||||
nnoremap <silent> <C-k> :call VSCodeNotify('workbench.action.navigateUp')<CR>
|
|
||||||
xnoremap <silent> <C-k> :call VSCodeNotify('workbench.action.navigateUp')<CR>
|
|
||||||
nnoremap <silent> <C-h> :call VSCodeNotify('workbench.action.navigateLeft')<CR>
|
|
||||||
xnoremap <silent> <C-h> :call VSCodeNotify('workbench.action.navigateLeft')<CR>
|
|
||||||
nnoremap <silent> <C-l> :call VSCodeNotify('workbench.action.navigateRight')<CR>
|
|
||||||
xnoremap <silent> <C-l> :call VSCodeNotify('workbench.action.navigateRight')<CR>
|
|
||||||
|
|
||||||
nnoremap gr <Cmd>call VSCodeNotify('editor.action.goToReferences')<CR>
|
|
||||||
|
|
||||||
" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors
|
|
||||||
" xnoremap <expr> <C-/> <SID>vscodeCommentary()
|
|
||||||
" nnoremap <expr> <C-/> <SID>vscodeCommentary() . '_'
|
|
||||||
|
|
||||||
nnoremap <silent> <C-w>_ :<C-u>call VSCodeNotify('workbench.action.toggleEditorWidths')<CR>
|
|
||||||
|
|
||||||
nnoremap <silent> <Space> :call VSCodeNotify('whichkey.show')<CR>
|
|
||||||
xnoremap <silent> <Space> :<C-u>call <SID>openWhichKeyInVisualMode()<CR>
|
|
||||||
|
|
||||||
xnoremap <silent> <C-P> :<C-u>call <SID>openVSCodeCommandsInVisualMode()<CR>
|
|
||||||
|
|
||||||
xmap gc <Plug>VSCodeCommentary
|
|
||||||
nmap gc <Plug>VSCodeCommentary
|
|
||||||
omap gc <Plug>VSCodeCommentary
|
|
||||||
nmap gcc <Plug>VSCodeCommentaryLine
|
|
||||||
|
|
||||||
" Simulate same TAB behavior in VSCode
|
|
||||||
nmap <Tab> :Tabnext<CR>
|
|
||||||
nmap <S-Tab> :Tabprev<CR>
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
|
||||||
|
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
|
||||||
|
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
|
||||||
|
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
|
||||||
|
|
||||||
|
/bin/bash -c "$(curl -fsSL https://mirrors.ustc.edu.cn/misc/brew-install.sh)"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# install neovim
|
||||||
|
cd /usr/local
|
||||||
|
wget https://github.com/neovim/neovim/releases/download/stable/nvim-macos.tar.gz
|
||||||
|
tar zxvf nvim-macos.tar.gz
|
||||||
@@ -14,7 +14,3 @@ ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/
|
|||||||
ln -sf ~/.dotfile/.tmux.conf ~/
|
ln -sf ~/.dotfile/.tmux.conf ~/
|
||||||
ln -sf ~/.dotfile/git/.gitconfig ~/.gitconfig
|
ln -sf ~/.dotfile/git/.gitconfig ~/.gitconfig
|
||||||
|
|
||||||
# install neovim
|
|
||||||
cd /usr/local
|
|
||||||
wget https://github.com/neovim/neovim/releases/download/v0.6.0/nvim-macos.tar.gz
|
|
||||||
tar zxvf nvim-macos.tar.gz
|
|
||||||
Reference in New Issue
Block a user