45 Commits

Author SHA1 Message Date
laily f0186eaefb feat: add script 2024-06-05 19:37:18 +08:00
laily 6283ab3cfb feat: support dap 2024-05-21 14:22:14 +08:00
laily 22b880e642 fix: modify gopls for completion 2024-05-08 20:20:43 +08:00
laily 2a68d143a8 fix: modify lsp 2024-05-04 15:47:07 +08:00
laily 05053a87b7 fix: disable auto format 2024-04-30 17:43:53 +08:00
laily 27dff38b7c fix: new lsp 2024-04-29 19:06:42 +08:00
laily cabec5bd63 fix: rm unused files 2024-03-22 15:48:03 +08:00
laily e430d2a721 fix: add env 2024-03-22 11:06:57 +08:00
laily a48619031d fix: modify nvim config 2024-03-22 11:05:02 +08:00
laily 7ef3a2f073 fix: jump 2024-02-29 14:52:44 +08:00
laily ddda0a2a02 fix: save lazy-lock 2024-02-29 10:54:55 +08:00
laily 685b477e1b fix: plugin 2024-02-28 22:01:26 +08:00
laily dc01c402c8 fix: modify plugin directory 2024-02-28 16:38:02 +08:00
laily b1698fb7cf fix: update telegraf 2024-02-22 20:26:43 +08:00
laily fad2c5fed9 fix: update telegraf 2024-02-22 20:17:41 +08:00
laily 23c83906b5 feat: add prettier 2024-02-21 20:54:58 +08:00
laily 820d501911 fix: c-p to search file 2024-02-21 17:41:48 +08:00
laily 0b7374d42a feat: add new plugin 2024-02-20 21:52:06 +08:00
laily b49026c12e feat: new config 2024-02-20 21:19:43 +08:00
laily 3fad1b11f4 feat: update gitcofig 2024-02-20 19:24:22 +08:00
laily b63fb4494c feat: add fish 2024-02-05 15:28:56 +08:00
laily a103031734 fix: modify nvim-tree 2023-11-06 14:58:22 +08:00
laily f12a4caccb fix: update autocommands 2023-09-15 14:10:38 +08:00
laily fa8b291b1d feat: modify some script 2023-09-13 14:21:52 +08:00
laily 47f16510b2 feat: modify for v0.9.2 2023-09-13 12:29:12 +08:00
laily d2aa7bad86 feat: modify git config 2023-09-07 18:03:21 +08:00
laily 9b9a929281 fix(ci): modify err check 2023-07-31 19:50:17 +08:00
laily e10a850527 feat: add plugin nvim lint 2023-04-27 11:43:55 +08:00
laily 7d83cc0d6e feat: add comment ci 2023-04-26 17:35:00 +08:00
laily d42ae1bb29 fix: linter 2023-04-21 12:24:49 +08:00
laily 96f4181e5f fix: linter 2023-04-21 12:05:30 +08:00
laily 53ab00c196 fix: workrepo 2023-04-19 11:32:29 +08:00
laily 1def7fc888 fix: add alias 2023-04-19 10:57:07 +08:00
laily c20d5f6024 fix: add a command 2023-03-21 15:13:21 +08:00
laily 6c36082c4f merge: master 2023-03-21 14:58:18 +08:00
laily 2072b48df7 fix: modify sub gitconfig 2023-03-21 14:53:18 +08:00
laily 83dbf07703 fix: modify sub gitconfig 2023-03-21 14:48:19 +08:00
laily 1fd0cdaf63 fix: update linux brew 2023-03-14 15:37:04 +08:00
laily 06cf9bae2c fix: add lock file 2023-01-03 11:53:59 +08:00
laily 77d16ce217 fix: modify nvim colorscheme 2022-12-30 14:10:56 +08:00
laily 8bc810fd39 fix: modify nvim plugin 2022-12-30 12:02:36 +08:00
laily 3180d287e7 Merge branch 'master' of github.com:hilaily/.dotfile 2022-12-30 11:35:23 +08:00
laily 46a920d574 fix: modify alias 2022-12-30 11:35:17 +08:00
laily 9a61a98643 fix: modify client.resolved_capabilities to client.server_capabilities 2022-12-01 21:12:05 +08:00
laily c92d815b3f 1. update nvim config of version 0.8.1
2. modify brew environment
2022-12-01 21:06:07 +08:00
107 changed files with 1766 additions and 4357 deletions
+4
View File
@@ -2,3 +2,7 @@
.SpaceVim.d/init.vim
.DS_Store
nvim/plugin
_set_env_*.sh
_set_env.sh
log
cn.sh
+44 -87
View File
@@ -4,21 +4,47 @@ run:
linters:
enable:
- govet
- errcheck
- staticcheck
- unused
- ineffassign
- typecheck
- exportloopref
- bodyclose
- gofmt
- misspell
- gosimple
- stylecheck
- revive
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
disable-all: true
linters-settings:
errcheck:
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
- net.(*)
staticcheck:
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
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:
# Maximum number of open files at the same time.
# See https://github.com/mgechev/revive#command-line-flags
@@ -34,26 +60,17 @@ linters:
severity: error
# Enable all available rules.
# Default: false
enable-all-rules: true
enable-all-rules: false
# Sets the default failure confidence.
# This means that linting errors with less than 0.8 confidence will be ignored.
# Default: 0.8
confidence: 0.1
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
- name: argument-limit
severity: warning
disabled: false
arguments: [4]
arguments: [6]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
- name: atomic
severity: warning
@@ -62,15 +79,7 @@ linters:
- name: banned-characters
severity: warning
disabled: false
arguments: ["Ω", "Σ", "σ", "7"]
# 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
arguments: ["Ω", "Σ", "σ"]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
- name: bool-literal-in-expr
severity: warning
@@ -83,15 +92,7 @@ linters:
- name: cognitive-complexity
severity: warning
disabled: false
arguments: [7]
# 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
arguments: [14]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr
- name: constant-logical-expr
severity: warning
@@ -108,7 +109,7 @@ linters:
- name: cyclomatic
severity: warning
disabled: false
arguments: [3]
arguments: [10]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
- name: datarace
severity: warning
@@ -123,10 +124,6 @@ linters:
disabled: false
arguments:
- ["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
- name: duplicated-imports
severity: warning
@@ -135,14 +132,6 @@ linters:
- name: early-return
severity: warning
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
- name: error-naming
severity: warning
@@ -166,26 +155,16 @@ linters:
arguments:
- "checkPrivateReceivers"
- "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
- name: function-result-limit
severity: warning
disabled: false
arguments: [2]
arguments: [4]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length
- name: function-length
severity: warning
disabled: false
arguments: [10, 0]
arguments: [100, 0]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
- name: get-return
severity: warning
@@ -213,24 +192,6 @@ linters:
arguments:
- "crypto/md5"
- "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
- name: modifies-value-receiver
severity: warning
@@ -276,10 +237,10 @@ linters:
severity: warning
disabled: false
arguments:
- - 'core.WriteError[1].Message'
- '/^([^A-Z]|$)/'
- - "core.WriteError[1].Message"
- "/^([^A-Z]|$)/"
- must not start with a capital letter
- - 'fmt.Errorf[0]'
- - "fmt.Errorf[0]"
- '/(^|[^\.!?])$/'
- must not end in punctuation
- - panic
@@ -304,7 +265,7 @@ linters:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
- name: var-naming
severity: warning
disabled: false
disabled: true
arguments:
- ["ID"] # AllowList
- ["VM"] # DenyList
@@ -326,10 +287,14 @@ linters:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
- name: unhandled-error
severity: warning
disabled: false
disabled: true
# bytes.Buffer.Write: package name, structure name, function name
arguments:
- "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
- name: unnecessary-stmt
severity: warning
@@ -338,14 +303,6 @@ linters:
- name: unreachable-code
severity: warning
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
- name: useless-break
severity: warning
+3
View File
@@ -32,6 +32,9 @@ bind -r L resizep -R 10 # 绑定Ctrl+l为往→调整面板边缘10个单元格
# 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候
set -s escape-time 1
# 返回上一个窗口
bind g last-window
# 设置窗口名为当前目录名
set-option -g status-interval 10
set-option -g automatic-rename on
+16 -8
View File
@@ -106,25 +106,29 @@ unsetopt BEEP
# unsetopt LIST_BEEP
# brew
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_NO_AUTO_UPDATE=true # 禁止 brew 每次安装软件都 upate
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"
# git
export REVIEW_BASE="master"
# go
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export GOPATH=$HOME/go:$HOME/workrepo/go
export PATH=$PATH:$HOME/go/bin
export GOPROXY=goproxy.cn
export GOSUMDB="sum.golang.google.cn"
[ -f ~/.zprofile ] && source ~/.zprofile
[ -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
if command -v lua >/dev/null; then
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="/usr/local/sbin:$PATH"
@@ -137,9 +141,13 @@ alias alert='terminal-notifier -title "Terminal" -message "Done with task! Exit
# git
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
alias ct="go test -gcflags=all=-l -cover ./..."
alias ci="golangci-lint -c=~/.dotfile/.golangci.yml run ./..."
alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..."
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 sws="swagger serve -F=swagger"
function gtr(){
go test -gcflags=all=-l -v -run="$1"
}
fpath+=${ZDOTDIR:-~}/.zsh_functions
+9 -1
View File
@@ -1,9 +1,13 @@
### 使用
```shell
git clone https://github.com/Laily123/.dotfile.git ~/.dotfile
```
### zsh 安装
安装 zsh
```shell
https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
# macOS
@@ -15,10 +19,13 @@ apt install zsh
```
安装 oh-my-zsh
```shell
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
```
初始化配置
```shell
ln -sf ~/.dotfile/.zshrc ~/
ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/
@@ -27,9 +34,10 @@ ln -sf ~/.dotfile/.gitconfig ~/.gitconfig
```
### spacevim 安装
安装
`curl -sLf https://spacevim.org/install.sh | bash`
初始化配置
`ln -sf ~/.dotfile/.SpaceVim.d ~/`
#
+53
View File
@@ -0,0 +1,53 @@
fish_vi_key_bindings
## 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
# add my script
set -gx PATH $PATH $HOME/.dotfile/script $HOME/.app00/script
# 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=$argv
end
if test -f ~/.config/fish/custom.fish
source ~/.config/fish/custom.fish
end
if status is-interactive
# Commands to run in interactive sessions can go here
end
+4
View File
@@ -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
View File
@@ -4,23 +4,40 @@
[core]
autocrlf = input
quotepath = false
editor = /usr/local/bin/nvim
editor = nvim
excludesfile = ~/.dotfile/git/.gitignore
[push]
default = current
[pull]
rebase = false
[color]
status = auto
diff = auto
branch = auto
interactive = auto
grep = auto
ui = auto
[merge]
tool = vimdiff
[include]
path = ~/.subgitconfig
tool = nvimdiff
[difftool "nvimdiff"]
cmd = nvim -d \"$LOCAL\" \"$REMOTE\"
[mergetool "nvimdiff"]
cmd = nvim -d \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[includeIf "gitdir:~/workrepo/"]
path = ~/.workgitconfig
[branch]
autoSetupMerge = always
[alias]
au = add -u
co = checkout
cm = commit -m
cm = "!f() { if [[ -z \"$1\" ]]; then git commit; else git commit -m \"$*\"; fi; }; f"
st = status
ap = add -p
br = branch
ba = branch -a
bm = branch --merged
bn = branch --no-merged
pl = pull
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' -
@@ -44,4 +61,6 @@
# instead of opening all files:
# git reviewone foo.js bar.js
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
+5
View File
@@ -26,7 +26,12 @@ _testmain.go
*.sublime-workspace
.idea/
.vscode/
.SpaceVim.d/.netrwhist
.SpaceVim.d/init.vim
.DS_Store
.log
go.work
go.work.sum
init_test.go
_set_env.sh
_set_env_*.sh
-20
View File
@@ -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
View File
@@ -1 +0,0 @@
setl ts=2 sw=2
-1
View File
@@ -1 +0,0 @@
require('lang.go')
-1
View File
@@ -1 +0,0 @@
setl ts=2 sw=2
-1
View File
@@ -1 +0,0 @@
setl ts=2 sw=2
-1
View File
@@ -1 +0,0 @@
setl commentstring={/*%s*/} ts=2 sw=2
-1
View File
@@ -1 +0,0 @@
require('lang.js-ts')
-3
View File
@@ -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')
-2
View File
@@ -1,2 +0,0 @@
require('lang.bash')
-1
View File
@@ -1 +0,0 @@
require('lang.js-ts')
-2
View File
@@ -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
-2
View File
@@ -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
View File
@@ -1 +0,0 @@
setl ts=2 sw=2 ts=2 ai et
-10
View File
@@ -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}
+31 -28
View File
@@ -1,33 +1,36 @@
CONFIG_PATH = vim.fn.stdpath('config')
DATA_PATH = vim.fn.stdpath('data')
CACHE_PATH = vim.fn.stdpath('cache')
P = vim.inspect
if vim.loader then
vim.loader.enable()
end
require('lv-globals')
vim.cmd('luafile '..CONFIG_PATH..'/settings.lua')
require('settings')
require('plugins')
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
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- TODO is there a way to do this without vimscript
vim.cmd('source '..CONFIG_PATH..'/vimscript/functions.vim')
_G.dd = function(...)
require("utils.debug").dump(...)
end
vim.print = _G.dd
-- LSP
require('lsp')
require("config.lazy")
--[[
require('lsp.css-ls')
require('lsp.docker-ls')
require('lsp.emmet-ls')
require('lsp.html-ls')
require('lsp.json-ls')
require('lsp.latex-ls')
require('lsp.python-ls')
require('lsp.rust-ls')
require('lsp.yaml-ls')
]]
-- CONFIG_PATH = vim.fn.stdpath('config')
-- DATA_PATH = vim.fn.stdpath('data')
-- CACHE_PATH = vim.fn.stdpath('cache')
-- P = vim.inspect
-- require('lv-globals')
-- vim.cmd('luafile '..CONFIG_PATH..'/settings.lua')
-- require('settings')
-- require('plugins')
-- 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')
+73
View File
@@ -0,0 +1,73 @@
{
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LazyVim": { "branch": "main", "commit": "530e94a9fa19577401e968a9673282c3d79f01e3" },
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
"SchemaStore.nvim": { "branch": "main", "commit": "8c46453bdf84ad91877effb95e0b6c7b51ea7dda" },
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
"bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" },
"catppuccin": { "branch": "main", "commit": "6af91673ceccbd6e073b66c439e7fce239f72d24" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "6dc1603ea408f476a57937bbeaf7f86520a21a98" },
"dashboard-nvim": { "branch": "master", "commit": "a0a78099658c7d4be3714f657b18ca8285d5d106" },
"dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" },
"flash.nvim": { "branch": "main", "commit": "7bb4a9c75d1e20cd24185afedeaa11681829ba23" },
"friendly-snippets": { "branch": "main", "commit": "3e9a3f5a0cfcef1741e352c37bda4e82e5eb846a" },
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"mini.ai": { "branch": "main", "commit": "55e9b7217f29e62f734e239bfeed5731a065d801" },
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
"mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" },
"mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" },
"mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" },
"mini.surround": { "branch": "main", "commit": "0f528eb2e1bab420c0569d9e52615144c51db920" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" },
"neoconf.nvim": { "branch": "main", "commit": "d4a48c2a6fdeec138605cee4eb6f8c6fafd0b3ed" },
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
"neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" },
"neotest-go": { "branch": "main", "commit": "27c80deab9cf5cb30b20ee407b3a6c7285518128" },
"neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
"noice.nvim": { "branch": "main", "commit": "f4decbc7a80229ccc9f86026b74bdcf0c39e38a7" },
"nui.nvim": { "branch": "main", "commit": "a3597dc88b53489d3fddbddbbd13787355253bb0" },
"nvim-cmp": { "branch": "main", "commit": "cd2cf0c124d3de577fb5449746568ee8e601afc8" },
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
"nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
"nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" },
"nvim-lspconfig": { "branch": "master", "commit": "a3d9395455f2b2e3b50a0b0f37b8b4c23683f44a" },
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" },
"nvim-tree.lua": { "branch": "master", "commit": "64f61e4c913047a045ff90bd188dd3b54ee443cf" },
"nvim-treesitter": { "branch": "master", "commit": "3607d9c59cb16ed5368ecfed53e8ca1735bb98fb" },
"nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bdccb9c67a42a5e2d99384dc9bfa29b1451528f" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "4d5fd21bae12ee6e9a79232e1c377f43c419d0c5" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" },
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}
+10
View File
@@ -0,0 +1,10 @@
{
"extras": [
"lazyvim.plugins.extras.test.core",
"lazyvim.plugins.extras.lang.go"
],
"news": {
"NEWS.md": "3314"
},
"version": 3
}
-1
View File
@@ -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"}}
-76
View File
@@ -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
})
-3
View File
@@ -1,3 +0,0 @@
vim.cmd('let g:nvcode_termcolors=256')
vim.cmd('colorscheme ' .. O.colorscheme)
+18
View File
@@ -0,0 +1,18 @@
-- 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","css","html" },
callback = function()
vim.opt.conceallevel = 0
vim.bo.tabstop = 2
vim.bo.softtabstop = 2
vim.bo.shiftwidth = 2
vim.bo.expand = true
end,
})
+164
View File
@@ -0,0 +1,164 @@
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>c
keymap.set('n', "<Leader>cs", "<cmd>SymbolsOutline<cr>", { desc = "Symbols Outline" })
-- <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','v'}, '<Leader>la', "<cmd>lua vim.lsp.buf.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>ln', "<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>ll', "<cmd>lua vim.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.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>lua vim.lsp.buf.rename()<cr>", { desc = "Rename" })
--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 })
+49
View File
@@ -0,0 +1,49 @@
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.dap.core" },
{ 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",
},
},
},
})
+64
View File
@@ -0,0 +1,64 @@
vim.g.autoformat = true
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)
-81
View File
@@ -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 })")
-6
View File
@@ -1,6 +0,0 @@
-- npm i -g bash-language-server
require'lspconfig'.bashls.setup {
cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"},
on_attach = require'lsp'.common_on_attach,
filetypes = { "sh", "zsh" }
}
-8
View File
@@ -1,8 +0,0 @@
-- npm install -g vscode-css-languageserver-bin
require'lspconfig'.cssls.setup {
cmd = {
"node", DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js",
"--stdio"
},
on_attach = require'lsp'.common_on_attach
}
-6
View File
@@ -1,6 +0,0 @@
-- npm install -g dockerfile-language-server-nodejs
require'lspconfig'.dockerls.setup {
cmd = {DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio"},
on_attach = require'lsp'.common_on_attach,
root_dir = vim.loop.cwd
}
-19
View File
@@ -1,19 +0,0 @@
local nvim_lsp = require'lspconfig'
local configs = require'lspconfig/configs'
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
configs.emmet_ls = {
default_config = {
cmd = {'emmet-ls', '--stdio'};
filetypes = {'html', 'css'};
root_dir = function()
return vim.loop.cwd()
end;
settings = {};
};
}
nvim_lsp.emmet_ls.setup{
-- on_attach = on_attach;
}
-146
View File
@@ -1,146 +0,0 @@
-- LSP
require 'lspconfig'.gopls.setup {
-- cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } },
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
init_options = { usePlaceholders = true, completeUnimported = true },
on_attach = require 'lsp'.common_on_attach
}
--[[
require'dap-install'.config("go_delve",{})
-- DAP
local dap = require "dap"
vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''})
--vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
local M = {}
local ts_utils = require 'nvim-treesitter.ts_utils'
function M.get_node()
local n = ts_utils.get_node_at_cursor()
put(ts_utils.get_node_text(n))
end
function M.get_node2()
local current_node = ts_utils.get_node_at_cursor()
if not current_node then
return ""
end
local expr = current_node
while expr do
if expr:type() == 'function_definition' then
put(expr:type())
break
end
expr = expr:parent()
end
if not expr then return "" end
put(ts_utils.get_node_text(expr))
return (ts_utils.get_node_text(expr:child(1)))[1]
end
return M
--[[
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
dap.configurations.go = {
{
type = "go",
name = "Debug",
request = "launch",
program = "${file}"
},
-- works with go.mod packages and sub packagesfunction M.get_current_function_name() local current_node = ts_utils.get_node_at_cursor() if not current_node then return "" end
local expr = current_node
while expr do
if expr:type() == 'function_definition' then
break
end
expr = expr:parent()
end
if not expr then return "" end
return (ts_utils.get_node_text(expr:child(1)))[1]
end
{
type = "go",
name = "Debug test (go.mod)",
request = "launch",
mode = "test",
program = "./${relativeFileDirname}"
}
}
--[[
local dap = require('dap')
dap.adapters.go = function(callback, config)
local stdout = vim.loop.new_pipe(false)
local handle
local pid_or_err
local port = 38697
local opts = {
stdio = {nil, stdout},
args = {"dap", "-l", "127.0.0.1:" .. port},
detached = true
}
handle, pid_or_err = vim.loop.spawn("dlv", opts, function(code)
stdout:close()
handle:close()
if code ~= 0 then
print('dlv exited with code', code)
end
end)
assert(handle, 'Error running dlv: ' .. tostring(pid_or_err))
stdout:read_start(function(err, chunk)
assert(not err, err)
if chunk then
vim.schedule(function()
require('dap.repl').append(chunk)
end)
end
end)
-- Wait for delve to start
vim.defer_fn(
function()
callback({type = "server", host = "127.0.0.1", port = port})
end,
100)
end
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
dap.configurations.go = {
{
type = "go",
name = "Debug",
request = "launch",
program = "${file}"
},
{
type = "go",
name = "Debug test", -- configuration for debugging test files
request = "launch",
mode = "test",
program = "${file}"
},
-- works with go.mod packages and sub packages
{
type = "go",
name = "Debug test (go.mod)",
request = "launch",
mode = "test",
program = "./${relativeFileDirname}"
}
}
]]
-9
View File
@@ -1,9 +0,0 @@
-- npm install -g vscode-html-languageserver-bin
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require'lspconfig'.html.setup {
cmd = {"node", DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", "--stdio"},
on_attach = require'lsp'.common_on_attach,
capabilities = capabilities
}
-28
View File
@@ -1,28 +0,0 @@
-- npm install -g typescript typescript-language-server
-- require'snippets'.use_suggested_mappings()
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
-- capabilities.textDocument.completion.completionItem.snippetSupport = true;
-- local on_attach_common = function(client)
-- print("LSP Initialized")
-- require'completion'.on_attach(client)
-- require'illuminate'.on_attach(client)
-- end
require'lspconfig'.tsserver.setup {
cmd = {DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", "--stdio"},
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
on_attach = require'lsp'.tsserver_on_attach,
-- This makes sure tsserver is not used for formatting (I prefer prettier)
-- on_attach = require'lsp'.common_on_attach,
root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
settings = {documentFormatting = false},
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = O.tsserver.diagnostics.virtual_text,
signs = O.tsserver.diagnostics.signs,
underline = O.tsserver.diagnostics.underline,
update_in_insert = true
})
}
}
-16
View File
@@ -1,16 +0,0 @@
-- npm install -g vscode-json-languageserver
require'lspconfig'.jsonls.setup {
cmd = {
"node", DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
"--stdio"
},
on_attach = require'lsp'.common_on_attach,
commands = {
Format = {
function()
vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0})
end
}
}
}
-4
View File
@@ -1,4 +0,0 @@
require'lspconfig'.texlab.setup{
cmd = {DATA_PATH .. "/lspinstall/latex/texlab"},
on_attach = require'lsp'.common_on_attach
}
-28
View File
@@ -1,28 +0,0 @@
-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
local brew_path = "/usr/local/Cellar/lua-language-server/2.5.5/libexec"
local sumneko_root_path = brew_path
local sumneko_binary = brew_path .. "/bin/lua-language-server"
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"},
on_attach = require'lsp'.common_on_attach,
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = vim.split(package.path, ';')
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'}
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true},
maxPreload = 10000
}
}
}
}
-22
View File
@@ -1,22 +0,0 @@
-- npm i -g pyright
require'lspconfig'.pyright.setup {
cmd = {DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", "--stdio"},
on_attach = require'lsp'.common_on_attach,
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = O.python.diagnostics.virtual_text,
signs = O.python.diagnostics.signs,
underline = O.python.diagnostics.underline,
update_in_insert = true
})
},
settings = {
python = {
analysis = {
typeCheckingMode = O.python.analysis.type_checking,
autoSearchPaths = O.python.analysis.auto_search_paths,
useLibraryCodeForTypes = O.python.analysis.use_library_code_types
}
}
}
}
-5
View File
@@ -1,5 +0,0 @@
require'lspconfig'.rust_analyzer.setup{
cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
on_attach = require'lsp'.common_on_attach
}
-5
View File
@@ -1,5 +0,0 @@
-- npm install -g yaml-language-server
require'lspconfig'.yamlls.setup{
cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"},
on_attach = require'lsp'.common_on_attach,
}
-119
View File
@@ -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.resolved_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.resolved_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
-66
View File
@@ -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
-3
View File
@@ -1,3 +0,0 @@
vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<S-x>', ':BufferClose<CR>', { noremap = true, silent = true })
-63
View File
@@ -1,63 +0,0 @@
--[[
local dashboard = {
custom_header = {
' _..._ ',
' .\' (_`. _ __ ___ ',
' : . : | | _ _ _ __ __ _ _ _\\ \\ / (_)_ __ ___ ',
' :) () : | | | | | | \'_ \\ / _` | \'__\\ \\ / /| | \'_ ` _ \\ ',
' `. . .\' | |__| |_| | | | | (_| | | \\ V / | | | | | | |',
' `-...-\' |_____\\__,_|_| |_|\\__,_|_| \\_/ |_|_| |_| |_|',
},
footer= {'Laily'}
}
]]
local dashboard = {
custom_header = {
'███╗ ██╗██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗',
'████╗ ██║██║ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝',
'██╔██╗ ██║██║ ██║██║ ██║ ██║██║ ██║█████╗',
'██║╚██╗██║╚██╗ ██╔╝██║ ██║ ██║██║ ██║██╔══╝',
'██║ ╚████║ ╚████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗',
'╚═╝ ╚═══╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝'
},
footer= {'Laily'},
}
-- vim.g.dashboard_custom_header = {
--
-- ' _..._ ',
-- ' .\' `. ██  ██  ██ ███  ██  █████  ██████  ██  ██ ██ ███  ███ ',
-- ' : : ██  ██  ██ ████  ██ ██   ██ ██   ██ ██  ██ ██ ████  ████ ',
-- ' : : ██  ██  ██ ██ ██  ██ ███████ ██████  ██  ██ ██ ██ ████ ██ ',
-- ' `. .\' ██  ██  ██ ██  ██ ██ ██   ██ ██   ██  ██  ██  ██ ██  ██  ██ ',
-- ' `-...-\' ███████  ██████  ██   ████ ██  ██ ██  ██   ████   ██ ██      ██ ',
--
-- }
vim.g.dashboard_custom_header = dashboard.custom_header
vim.g.dashboard_default_executive = 'telescope'
vim.g.dashboard_custom_section = {
a = {description = {' Find File '}, command = 'Telescope find_files'},
b = {description = {' Recently Used Files'}, command = 'Telescope oldfiles'},
c = {description = {' Load Last Session '}, command = 'SessionLoad'},
d = {description = {' Find Word '}, command = 'Telescope live_grep'},
e = {description = {' Settings '}, command = ':e '..CONFIG_PATH..'/lv-settings.lua'}
-- e = {description = {' Marks '}, command = 'Telescope marks'}
}
-- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
-- vim.g.dashboard_custom_shortcut = {
-- a = 'f',
-- find_word = 'SPC f a',
-- last_session = 'SPC s l',
-- new_file = 'SPC c n',
-- book_marks = 'SPC f b'
-- }
-- find_history = 'SPC f h',
-- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
vim.g.dashboard_custom_footer = dashboard.footer
-11
View File
@@ -1,11 +0,0 @@
require'fzf-lua'.setup {
fzf_opts = { ['--keep-right'] = ''},
fzf_cli_args = '--keep-right',
--[[
winopts = {
preview = {
layout = "vertical"
}
}
]]
}
-220
View File
@@ -1,220 +0,0 @@
local gl = require('galaxyline')
-- get my theme in galaxyline repo
-- local colors = require('galaxyline.theme').default
local colors = {
-- bg = '#2E2E2E',
bg = '#292D38',
yellow = '#DCDCAA',
dark_yellow = '#D7BA7D',
cyan = '#4EC9B0',
green = '#608B4E',
light_green = '#B5CEA8',
string_orange = '#CE9178',
orange = '#FF8800',
purple = '#C586C0',
magenta = '#D16D9E',
grey = '#858585',
blue = '#569CD6',
vivid_blue = '#4FC1FF',
light_blue = '#9CDCFE',
red = '#D16969',
error_red = '#F44747',
info_yellow = '#FFCC66'
}
local condition = require('galaxyline.condition')
local gls = gl.section
gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'}
table.insert(gls.left, {
ViMode = {
provider = function()
-- auto change color according the vim mode
local mode_color = {
n = colors.blue,
i = colors.green,
v = colors.purple,
[''] = colors.purple,
V = colors.purple,
c = colors.magenta,
no = colors.blue,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.red,
Rv = colors.red,
cv = colors.blue,
ce = colors.blue,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.blue,
t = colors.blue
}
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
return '▊ '
end,
highlight = {colors.red, colors.bg}
}
})
print(vim.fn.getbufvar(0, 'ts'))
vim.fn.getbufvar(0, 'ts')
table.insert(gls.left, {
GitIcon = {
provider = function()
return ''
end,
condition = condition.check_git_workspace,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.orange, colors.bg}
}
})
table.insert(gls.left, {
GitBranch = {
provider = 'GitBranch',
condition = condition.check_git_workspace,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.left, {
DiffAdd = {
provider = 'DiffAdd',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.green, colors.bg}
}
})
table.insert(gls.left, {
DiffModified = {
provider = 'DiffModified',
condition = condition.hide_in_width,
icon = ' 柳',
highlight = {colors.blue, colors.bg}
}
})
table.insert(gls.left, {
DiffRemove = {
provider = 'DiffRemove',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.red, colors.bg}
}
})
table.insert(gls.right, {
DiagnosticError = {provider = 'DiagnosticError', icon = '', highlight = {colors.error_red, colors.bg}}
})
table.insert(gls.right, {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = '', highlight = {colors.orange, colors.bg}}})
table.insert(gls.right, {
DiagnosticHint = {provider = 'DiagnosticHint', icon = '', highlight = {colors.vivid_blue, colors.bg}}
})
table.insert(gls.right, {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '', highlight = {colors.info_yellow, colors.bg}}})
table.insert(gls.right, {
TreesitterIcon = {
provider = function()
if next(vim.treesitter.highlighter.active) ~= nil then return '' end
return ''
end,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.green, colors.bg}
}
})
table.insert(gls.right, {
ShowLspClient = {
provider = 'GetLspClient',
condition = function()
local tbl = {['dashboard'] = true, [' '] = true}
if tbl[vim.bo.filetype] then return false end
return true
end,
icon = '',
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.right, {
LineInfo = {
provider = 'LineColumn',
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.right, {
PerCent = {
provider = 'LinePercent',
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.right, {
Tabstop = {
provider = function()
return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " "
end,
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.right, {
BufferType = {
provider = 'FileTypeName',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.right, {
FileEncode = {
provider = 'FileEncode',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.right, {
Space = {
provider = function()
return ' '
end,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.orange, colors.bg}
}
})
table.insert(gls.short_line_left, {
BufferType = {
provider = 'FileTypeName',
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
})
table.insert(gls.short_line_left, {
SFileName = {provider = 'SFileName', condition = condition.buffer_not_empty, highlight = {colors.grey, colors.bg}}
})
--table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}})
-23
View File
@@ -1,23 +0,0 @@
require('gitsigns').setup {
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,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
},
watch_gitdir = {
interval = 1000
},
sign_priority = 6,
update_debounce = 200,
status_formatter = nil, -- Use default
}
-2
View File
@@ -1,2 +0,0 @@
vim.api.nvim_set_keymap('n', 's', ":HopChar2<cr>", {silent = true})
vim.api.nvim_set_keymap('n', 'S', ":HopWord<cr>", {silent = true})
-37
View File
@@ -1,37 +0,0 @@
-- source plugin config
require('pluginconfig/barbar')
require('pluginconfig/dashboard-nvim')
require('pluginconfig/galaxyline')
require('pluginconfig/gitsigns')
require('pluginconfig/hop')
require('pluginconfig/lspinstall')
require('pluginconfig/lua-dev') -- must before lspconfig
require('pluginconfig/mkdx')
require('pluginconfig/neotest')
require('pluginconfig/numb')
require('pluginconfig/nvim-autopairs')
require('pluginconfig/nvim-colorizer')
require('pluginconfig/nvim-cmp')
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-treesitter')
require('pluginconfig/rnvimr')
require('pluginconfig/telescope')
require('pluginconfig/toggleterm')
require('pluginconfig/vim-matchup')
require('pluginconfig/which-key')
-- nvim_comment
require('nvim_comment').setup()
-- lsp-rooter
require("lsp-rooter").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
-- lsp signature
require("lsp_signature").setup()
-21
View File
@@ -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)
-3
View File
@@ -1,3 +0,0 @@
require("lua-dev").setup({
-- add any options here, or leave empty to use the default settings
})
-7
View File
@@ -1,7 +0,0 @@
vim.cmd([[
let g:mkdx#settings = { 'highlight': { 'enable': 1 },
\ 'enter': { 'shift': 1 },
\ 'links': { 'external': { 'enable': 1 } },
\ 'toc': { 'text': 'Table of Contents', 'update_on_write': 1 },
\ 'fold': { 'enable': 1 } }
]])
-10
View File
@@ -1,10 +0,0 @@
require("neotest").setup({
adapters = {
require("neotest-go")({
experimental = {
test_table = true,
},
args = { "-gcflags=all=-l", "-count=1", "-timeout=60s" }
})
}
})
-4
View File
@@ -1,4 +0,0 @@
require('numb').setup{
show_numbers = true, -- Enable 'number' for the window while peeking
show_cursorline = true -- Enable 'cursorline' for the window while peeking
}
-123
View File
@@ -1,123 +0,0 @@
-- require('nvim-autopairs').setup()
-- local npairs = require('nvim-autopairs')
-- local function imap(lhs, rhs, opts)
-- local options = {noremap = false}
-- if opts then options = vim.tbl_extend('force', options, opts) end
-- vim.api.nvim_set_keymap('i', lhs, rhs, options)
-- end
-- _G.MUtils = {}
-- -- TEST
-- vim.g.completion_confirm_key = ""
-- MUtils.completion_confirm = function()
-- if vim.fn.pumvisible() ~= 0 then
-- if vim.fn.complete_info()["selected"] ~= -1 then
-- vim.fn["compe#confirm"]()
-- -- return npairs.esc("<c-y>")
-- return npairs.esc("")
-- else
-- vim.defer_fn(function()
-- vim.fn["compe#confirm"]("<cr>")
-- end, 20)
-- return npairs.esc("<c-n>")
-- end
-- else
-- return npairs.check_break_line_char()
-- end
-- end
-- -- TEST
-- MUtils.completion_confirm = function()
-- if vim.fn.pumvisible() ~= 0 then
-- if vim.fn.complete_info()["selected"] ~= -1 then
-- vim.fn["compe#confirm"]()
-- return npairs.esc("")
-- else
-- vim.api.nvim_select_popupmenu_item(0, false, false, {})
-- vim.fn["compe#confirm"]()
-- return npairs.esc("<c-n>")
-- end
-- else
-- return npairs.check_break_line_char()
-- end
-- end
-- MUtils.tab = function()
-- if vim.fn.pumvisible() ~= 0 then
-- return npairs.esc("<C-n>")
-- else
-- if vim.fn["vsnip#available"](1) ~= 0 then
-- vim.fn.feedkeys(string.format('%c%c%c(vsnip-expand-or-jump)', 0x80, 253, 83))
-- return npairs.esc("")
-- else
-- return npairs.esc("<Tab>")
-- end
-- end
-- end
-- MUtils.s_tab = function()
-- if vim.fn.pumvisible() ~= 0 then
-- return npairs.esc("<C-p>")
-- else
-- if vim.fn["vsnip#jumpable"](-1) ~= 0 then
-- vim.fn.feedkeys(string.format('%c%c%c(vsnip-jump-prev)', 0x80, 253, 83))
-- return npairs.esc("")
-- else
-- return npairs.esc("<C-h>")
-- end
-- end
-- end
-- -- Autocompletion and snippets
-- vim.api.nvim_set_keymap('i', '<CR>', 'v:lua.MUtils.completion_confirm()', {expr = true, noremap = true})
-- -- imap("<CR>", "v:lua.MUtils.completion_confirm()", {expr = true, noremap = true})
-- imap("<Tab>", "v:lua.MUtils.tab()", {expr = true, noremap = true})
-- imap("<S-Tab>", "v:lua.MUtils.s_tab()", {expr = true, noremap = true})
local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')
local Rule = require('nvim-autopairs.rule')
-- skip it, if you use another global object
_G.MUtils= {}
vim.g.completion_confirm_key = ""
MUtils.completion_confirm=function()
if vim.fn.pumvisible() ~= 0 then
if vim.fn.complete_info()["selected"] ~= -1 then
return vim.fn["compe#confirm"](npairs.esc("<cr>"))
else
return npairs.esc("<cr>")
end
else
return npairs.autopairs_cr()
end
end
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
npairs.setup({
check_ts = true,
ts_config = {
lua = {'string'},-- it will not add pair on that treesitter node
javascript = {'template_string'},
java = false,-- don't check treesitter on java
}
})
require('nvim-treesitter.configs').setup {
autopairs = {enable = true}
}
local ts_conds = require('nvim-autopairs.ts-conds')
-- press % => %% is only inside comment or string
npairs.add_rules({
Rule("%", "%", "lua")
:with_pair(ts_conds.is_ts_node({'string','comment'})),
Rule("$", "$", "lua")
:with_pair(ts_conds.is_not_ts_node({'function'}))
})
-92
View File
@@ -1,92 +0,0 @@
local lspkind = require('lspkind')
local cmp = require 'cmp'
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
cmp.setup {
-- 指定 snippet 引擎
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,
},
-- 来源
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 = 'buffer' },
{ name = 'path' }
}),
-- 快捷键
mapping = keymapping(cmp),
-- 使用lspkind-nvim显示类型图标
formatting = {
format = lspkind.cmp_format({
with_text = true, -- do not show text alongside icons
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
before = function(entry, vim_item)
-- Source 显示提示来源
vim_item.menu = "[" .. string.upper(entry.source.name) .. "]"
return vim_item
end
})
},
}
-- Use buffer source for `/`.
cmp.setup.cmdline('/', {
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':'.
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-13
View File
@@ -1,13 +0,0 @@
require'colorizer'.setup(
{'*';},
{
RGB = true; -- #RGB hex codes
RRGGBB = true; -- #RRGGBB hex codes
RRGGBBAA = true; -- #RRGGBBAA hex codes
rgb_fn = true; -- CSS rgb() and rgba() functions
hsl_fn = true; -- CSS hsl() and hsla() functions
css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn
})
-- names = true; -- "Name" codes like Blue
-75
View File
@@ -1,75 +0,0 @@
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
require'nvim-tree'.setup {
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 = true,
-- 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 = {}
},
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_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 = ""}
}
-29
View File
@@ -1,29 +0,0 @@
local treesitter = {
ensure_installed = "all",
highlight = { enabled = true },
playground = { enabled = true },
rainbow = { enabled = false },
}
require 'nvim-treesitter.configs'.setup {
ensure_installed = treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = { "haskell", "markdown", "swift" },
matchup = {
enable = true, -- mandatory, false will disable the whole extension
-- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
},
highlight = {
enable = true, -- false will disable the whole extension
disable = { "markdown" },
},
context_commentstring = {
enable = true,
config = {
css = '// %s'
}
},
-- indent = {enable = true, disable = {"python", "html", "javascript"}},
-- TODO seems to be broken
indent = { enable = { "javascriptreact" } },
autotag = { enable = true },
}
-6
View File
@@ -1,6 +0,0 @@
-- Make Ranger replace netrw and be the file explorer
-- vim.g.rnvimr_ex_enable = 1
vim.g.rnvimr_draw_border = 1
vim.g.rnvimr_pick_enable = 1
vim.g.rnvimr_bw_enable = 1
vim.api.nvim_set_keymap('n', '-', ':RnvimrToggle<CR>', {noremap = true, silent = true})
-81
View File
@@ -1,81 +0,0 @@
local actions = require('telescope.actions')
local trouble = require("trouble.providers.telescope")
-- Global remapping
------------------------------
-- '--color=never',
require('telescope').setup {
defaults = {
--find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'},
vimgrep_arguments = { 'rg', '--color=never', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' },
-- prompt_prefix = " ",
prompt_prefix = "",
selection_caret = "",
entry_prefix = " ",
initial_mode = "insert",
-- initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "descending",
layout_strategy = "horizontal",
layout_config= {horizontal = {mirror = false}, vertical = {mirror = false}, width = 0.75,prompt_position = "bottom", preview_cutoff = 120},
file_sorter = require'telescope.sorters'.get_fzy_sorter,
file_ignore_patterns = {},
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
-- shorten_path = true,
path_display = {shroten = 2},
winblend = 0,
border = {},
borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'},
color_devicons = true,
use_less = true,
set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil,
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
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,
-- To disable a keymap, put [map] = false
-- So, to not map "<C-n>", just put
-- ["<c-x>"] = false,
-- ["<esc>"] = actions.close,
-- Otherwise, just set the mapping to the function that you want it to be.
-- ["<C-i>"] = actions.select_horizontal,
-- Add up multiple actions
["<CR>"] = actions.select_default + actions.center
-- You can perform as many actions in a row as you like
-- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
},
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
-- ["<C-i>"] = my_cool_custom_action,
}
}
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
}
}
}
--require('telescope').load_extension('fzf')
require'telescope'.load_extension('project')
require("telescope").load_extension "file_browser"
-50
View File
@@ -1,50 +0,0 @@
require("toggleterm").setup {
-- size can be a number or function which is passed the current terminal
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = [[<c-\>]],
hide_numbers = true, -- hide the number column in toggleterm buffers
shade_filetypes = {},
shade_terminals = true,
shading_factor = '1', -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
persist_size = true,
-- direction = 'vertical' | 'horizontal' | 'window' | 'float',
direction = 'float',
close_on_exit = true, -- close the terminal window when the process exits
shell = vim.o.shell, -- change the default shell
-- This field is only relevant if direction is set to 'float'
float_opts = {
-- The border key is *almost* the same as 'nvim_open_win'
-- see :h nvim_open_win for details on borders however
-- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin.
-- border = 'single' | 'double' | 'shadow' | 'curved' -- ... other options supported by win open
border = 'single',
-- width = <value>,
-- height = <value>,
winblend = 3,
highlights = {
border = "Normal",
background = "Normal",
}
}
}
-- function _G.set_terminal_keymaps()
-- local opts = {noremap = true}
-- vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
-- vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
-- end
-- vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
-2
View File
@@ -1,2 +0,0 @@
vim.g.matchup_matchparen_offscreen = {method = 'popup'}
-249
View File
@@ -1,249 +0,0 @@
require("which-key").setup {
plugins = {
marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created
presets = {
operators = false, -- adds help for operators like d, y, ...
motions = false, -- adds help for motions
text_objects = false, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z
g = true -- bindings for prefixed with g
}
},
icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "➜", -- symbol used between a key and it's label
group = "+" -- symbol prepended to a group
},
window = {
border = "single", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 } -- extra window padding [top, right, bottom, left]
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3 -- spacing between columns
},
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
show_help = true -- show help message on the command line when the popup is visible
}
local opts = {
mode = "n", -- NORMAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = false -- use `nowait` when creating keymaps
}
-- Set leader
vim.api.nvim_set_keymap('n', '<Space>', '<NOP>', { noremap = true, silent = true })
vim.g.mapleader = ' '
-- no hl
vim.api.nvim_set_keymap('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = true })
-- explorer
vim.api.nvim_set_keymap('n', '<Leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
-- telescope
--vim.api.nvim_set_keymap('n', '<C-p>', ":lua require 'telescope'.extensions.file_browser.file_browser()<CR>", {noremap = true, silent = true})
-- vim.api.nvim_set_keymap('n', '<C-p>', ":lua require'telescope.builtin'.find_files()<CR>", {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<C-p>', ":FzfLua files<CR>", { noremap = true, silent = true })
-- dashboard
vim.api.nvim_set_keymap('n', '<Leader>;', ':Dashboard<CR>', { noremap = true, silent = true })
-- Comments
vim.api.nvim_set_keymap("n", "<Leader>b/", ":CommentToggle<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", "<Leader>b/", ":CommentToggle<CR>", { noremap = true, silent = true })
-- close buffer
vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true })
-- open projects
--vim.api.nvim_set_keymap('n', '<leader>p', ":lua require'telescope'.extensions.project.project{}<CR>", {noremap = true, silent = true})
-- vim.api.nvim_set_keymap('n', '<leader>p', ":lua require 'telescope'.extensions.file_browser.file_browser()<CR>", {noremap = true, silent = true})
-- TODO create entire treesitter section
local mappings = {
-- ["/"] = "Comment",
-- ["c"] = "Close Buffer",
["e"] = "Explorer",
-- ["f"] = "Find File",
["h"] = "No Highlight",
a = {
name = "+Action",
a = { "<cmd>@:<cr>", "execute last command again" }
},
b = {
name = "+Buffer",
n = { "<cmd>BufferNext<cr>", "next buffer" },
p = { "<cmd>BufferPrevious<cr>", "previous buffer" },
q = { "<cmd>q<cr>", "quit" },
s = { "<cmd>w<cr>", "save" },
r = { "<cmd>e!<cr>", "reload" },
d = { "<cmd>BufferClose<cr>", "close buffer" },
z = { "<cmd>CommentToggle<CR>", "toggle comment" },
},
D = {
name = "+Diagnostics",
t = { "<cmd>TroubleToggle<cr>", "trouble" },
w = { "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", "workspace" },
d = { "<cmd>TroubleToggle lsp_document_diagnostics<cr>", "document" },
q = { "<cmd>TroubleToggle quickfix<cr>", "quickfix" },
l = { "<cmd>TroubleToggle loclist<cr>", "loclist" },
r = { "<cmd>TroubleToggle lsp_references<cr>", "references" },
},
d = {
name = "+Debug",
-- b = {"<cmd>DebugToggleBreakpoint<cr>", "Toggle Breakpoint"},
-- c = {"<cmd>DebugContinue<cr>", "Continue"},
-- i = {"<cmd>DebugStepInto<cr>", "Step Into"},
-- o = {"<cmd>DebugStepOver<cr>", "Step Over"},
-- r = {"<cmd>DebugToggleRepl<cr>", "Toggle Repl"},
-- s = {"<cmd>DebugStart<cr>", "Start"}
d = { "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", "show diagnostics" },
c = { "<cmd>lua require'dap'.continue()<cr>", "continue" },
b = { ':lua require"dap".toggle_breakpoint()<CR>', "Toggle Breadpoint" },
j = { ':lua require"dap".step_over()<CR>', "step over" },
k = { ':lua require"dap".step_out()<CR>', "step out" },
l = { ':lua require"dap".step_into()<CR>', "step into" },
--<c-h>', ':lua require"dap".continue()<CR>')
u = { ':lua require"dap".up()<CR>', "up" },
-- d = {':lua require"dap".down()<CR>', "down"},
_ = { ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()<CR>', "disconnect" },
--r = {':lua require"dap".repl.open({}, "vsplit")<CR><C-w>l', "repl open"},
i = { ':lua require"dap.ui.variables".visual_hover()<CR>', "visual_hover" },
--? = {':lua require"dap.ui.variables".scopes()<CR>',"scopes"},
-- e = {':lua require"dap".set_exception_breakpoints({"all"})<CR>',"esception bp"},
-- a = {':lua require"debugHelper".attach()<CR>',"attach"},
-- A = {':lua require"debugHelper".attachToRemote()<CR>',"attach to remote"},
s = { ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)<CR>', "centered_float" },
},
f = {
name = "+File",
m = { "<cmd>lua require'utils'.open_md()<cr>", "open a markdown file in vscode" },
s = { "<cmd>w<cr>", "save file" },
t = { "<cmd>NvimTreeToggle<cr>", "toggle nvim tree" },
r = { "<cmd>RnvimrToggle<cr>", "toggle rnvimr" },
y = { "<cmd>lua require'utils'.yank_filepath()<cr>", "copy the file path" },
d = { "<cmd>lua require'utils'.yank_file_dir()<cr>", "copy the file path" },
l = { "<cmd>NvimTreeFindFile<CR>", "find file" },
-- T = {"<cmd>let @+ = 'go test -v -run='+expand('<cword>')<cr>", "get current word in go test"},
},
g = {
name = "+Git",
m = {"<cmd>Gvdiff master:%<cr>", "Diff with master"},
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
S = { "<cmd>lua require 'gitsigns'.stage_buffer()<cr>", "Stage Buffer" },
u = {
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
"Undo Stage Hunk",
},
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
C = {
"<cmd>Telescope git_bcommits<cr>",
"Checkout commit(for current file)",
},
d = {
"<cmd>Gitsigns diffthis HEAD<cr>",
"Git Diff",
},
},
l = {
name = "+Language",
a = { "<cmd>Lspsaga code_action<cr>", "Code Action" },
A = { "<cmd>Lspsaga range_code_action<cr>", "Selected Action" },
d = { "<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics" },
D = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
f = { "<cmd>LspFormatting<cr>", "Format" },
F = { "<cmd>Lspsaga lsp_finder<cr>", "LSP Finder" },
-- i = {"<cmd>Telescope lsp_implementations<cr>", "implement"},
i = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "implement" },
l = { "<cmd>lua vim.lsp.buf.hover()<cr>", "hover" },
L = { "<cmd>Lspsaga show_line_diagnostics<cr>", "Line Diagnostics" },
k = { "<cmd>: LspRestart<cr>", "restart lsp server" },
n = { "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", "next diagnostic" },
p = { "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", "prev diagnostic" },
P = { "<cmd>Lspsaga preview_definition<cr>", "Preview Definition" },
q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
r = { "<cmd>lua vim.lsp.buf.references()<cr>", "references" },
R = { "<cmd>Lspsaga rename<cr>", "Rename" },
t = { "<cmd>LspTypeDefinition<cr>", "Type Definition" },
x = { "<cmd>cclose<cr>", "Close Quickfix" },
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
S = { "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", "Workspace Symbols" },
z = { "<cmd>LspInfo<cr>", "Info" },
[","] = { "<cmd>LspInstallInfo<cr>", "LSP servers" }
},
p = {
name = "Packer",
c = { "<cmd>PackerCompile<cr>", "Compile" },
i = { "<cmd>PackerInstall<cr>", "Install" },
s = { "<cmd>PackerSync<cr>", "Sync" },
S = { "<cmd>PackerStatus<cr>", "Status" },
u = { "<cmd>PackerUpdate<cr>", "Update" },
},
q = {
name = "quit",
q = { "<cmd>qall<cr>", "quit" },
},
s = {
name = "+Search",
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
-- c = {"<cmd>Telescope colorscheme<cr>", "Colorscheme"},
c = { "<cmd>:nohl<cr>", "no highlight" },
d = { "<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics" },
D = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
f = { "<cmd>Fzflua files<cr>", "Find File" },
m = { "<cmd>Telescope marks<cr>", "Marks" },
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
r = { "<cmd>FzfLua oldfiles<cr>", "Open Recent File" },
R = { "<cmd>Telescope registers<cr>", "Registers" },
t = { "<cmd>FzfLua live_grep<cr>", "Text" },
["#"] = { "<cmd>FzfLua grep_cword<cr>", "Search word under cursor" },
},
S = {
name = "+Session",
s = { "<cmd>SessionSave<cr>", "Save Session" },
l = { "<cmd>SessionLoad<cr>", "Load Session" },
},
t = {
name = "+Test",
a = { "<cmd>TestSuite -v -cover<cr>", "TestSuite" },
t = { "<cmd>lua require('neotest').run.run() <cr>", "TestNearest" },
f = { '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))<cr>', "TestFile" },
c = { "<cmd>GoCover<cr>", "go coverage" },
C = { "<cmd>GoCoverClear<cr>", "go coverage clear" },
b = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "set break point" },
r = { "<cmd>lua require'dap'.continue()<cr>", "continue" },
},
-- extras
z = {
name = "+Zen",
s = { "<cmd>TZBottom<cr>", "toggle status line" },
t = { "<cmd>TZTop<cr>", "toggle tab bar" },
z = { "<cmd>TZAtaraxis<cr>", "toggle zen" },
}
}
local wk = require("which-key")
wk.register(mappings, opts)
-258
View File
@@ -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/lua-dev.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', tag = 'release', 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)
+19
View File
@@ -0,0 +1,19 @@
return {
{
-- tabline
'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
},
}
+11
View File
@@ -0,0 +1,11 @@
return {
-- for format
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
go = { "goimports"},
}
}
}
}
+21
View File
@@ -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,
},
}
+44
View File
@@ -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,
}
}
}
+7
View File
@@ -0,0 +1,7 @@
return {
{
"ray-x/lsp_signature.nvim",
opts = {},
config = function(_, opts) require'lsp_signature'.setup(opts) end
}
}
+17
View File
@@ -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,
},
}
+22
View File
@@ -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" }
})
}
},
},
}
+87
View File
@@ -0,0 +1,87 @@
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 {
{
"hrsh7th/nvim-cmp",
enable = false,
dependencies = {
"hrsh7th/cmp-emoji",
'hrsh7th/vim-vsnip',
'hrsh7th/vim-vsnip-integ',
},
opts = opts_func,
},
}
+11
View File
@@ -0,0 +1,11 @@
return {
"leoluz/nvim-dap-go",
keys = {
{ "<F5>", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<F6>",":lua require('dap-go').debug_test()<cr>", desc = "Debug Test" },
{ "<F9>", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<F10>", function() require("dap").step_over() end, desc = "Step Over" },
{ "<F11>", function() require("dap").step_into() end, desc = "Step Into" },
{ "<S-F11>", function() require("dap").step_out() end, desc = "Step Out" },
}
}
+151
View File
@@ -0,0 +1,151 @@
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 = {
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,
usePlaceholders = false,
}
},
},
pylsp = {
cmd = { "pylyzer", "--server" },
filetypes = { "python" },
settings = {
python = {
checkOnType = false,
diagnostics = false,
inlayHints = true,
smartCompletion = true
}
},
single_file_support = true,
}
},
setup = {},
},
},
}
+63
View File
@@ -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 = {}
},
},
},
}
+10
View File
@@ -0,0 +1,10 @@
return {
{
"simrat39/symbols-outline.nvim",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
cmd = "SymbolsOutline",
opts = {
position = "right",
},
},
}
+187
View File
@@ -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,
},
}
+72
View File
@@ -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,
},
}
-61
View File
@@ -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
]])
+158
View File
@@ -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
+1 -1
View File
@@ -19,7 +19,7 @@ end
function lv_utils.open_md()
local p = vim.fn.expand('%:p')
vim.fn.system("open -a typora "..p)
vim.fn.system("open -a marktext "..p)
end
function lv_utils.define_augroups(definitions) -- {{{1
-66
View File
@@ -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
-9
View File
@@ -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
-28
View File
@@ -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 \
-29
View File
@@ -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 \
-2
View File
@@ -1,2 +0,0 @@
#!/bin/bash
nvim -u ~/.config/nvcode/init.lua
-207
View File
@@ -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

-171
View File
@@ -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
-73
View File
@@ -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
-84
View File
@@ -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>

Some files were not shown because too many files have changed in this diff Show More