merge
This commit is contained in:
@@ -1,9 +1,23 @@
|
|||||||
func! myspacevim#before() abort
|
function! myspacevim#before() abort
|
||||||
|
autocmd VimEnter * nnoremap gd :lua vim.lsp.buf.definition()<CR>
|
||||||
|
call deoplete#custom#option('auto_complete', v:false)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
lua << EOF
|
||||||
|
local c = require('custom')
|
||||||
|
lcustom.init()
|
||||||
|
EOF
|
||||||
|
|
||||||
|
function! myspacevim#after() abort
|
||||||
set wrap
|
set wrap
|
||||||
"设置折叠方式
|
"设置折叠方式
|
||||||
set foldmethod=indent
|
set foldmethod=indent
|
||||||
" 打开文件默认不折叠
|
" 打开文件默认不折叠
|
||||||
set foldlevelstart=99
|
set foldlevelstart=99
|
||||||
|
let g:go_metalinter_autosave=0
|
||||||
|
let g:XkbSwitchEnabled = 1
|
||||||
|
|
||||||
|
"nnoremap <Space>k :<C-u>call gitblame#echo()<CR>
|
||||||
|
|
||||||
"大括号回车
|
"大括号回车
|
||||||
"inoremap { {<CR>}<up><end><CR>
|
"inoremap { {<CR>}<up><end><CR>
|
||||||
@@ -11,4 +25,6 @@ func! myspacevim#before() abort
|
|||||||
"inoremap , ,<Space>
|
"inoremap , ,<Space>
|
||||||
"等号左右空格
|
"等号左右空格
|
||||||
"inoremap = <Space>=<Space>
|
"inoremap = <Space>=<Space>
|
||||||
endf
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Regular → Executable
+37
-9
@@ -11,7 +11,8 @@
|
|||||||
# set spacevim theme. by default colorscheme layer is not loaded,
|
# set spacevim theme. by default colorscheme layer is not loaded,
|
||||||
# if you want to use more colorscheme, please load the colorscheme
|
# if you want to use more colorscheme, please load the colorscheme
|
||||||
# layer
|
# layer
|
||||||
colorscheme = "onedark"
|
auto_complete = false
|
||||||
|
colorscheme = "NeoSolarized"
|
||||||
background = "dark"
|
background = "dark"
|
||||||
# Disable guicolors in basic mode, many terminal do not support 24bit
|
# Disable guicolors in basic mode, many terminal do not support 24bit
|
||||||
# true colors
|
# true colors
|
||||||
@@ -21,20 +22,26 @@
|
|||||||
statusline_separator = "arrow"
|
statusline_separator = "arrow"
|
||||||
statusline_inactive_separator = "arrow"
|
statusline_inactive_separator = "arrow"
|
||||||
buffer_index_type = 4
|
buffer_index_type = 4
|
||||||
|
<<<<<<< HEAD
|
||||||
autocomplete_method = 'deoplete'
|
autocomplete_method = 'deoplete'
|
||||||
# autocomplete_method = 'lsp'
|
# autocomplete_method = 'lsp'
|
||||||
|
=======
|
||||||
|
#autocomplete_method = 'deoplete'
|
||||||
|
>>>>>>> c920830f6bd108e167886cdb7d3557c51e304e33
|
||||||
enable_tabline_filetype_icon = true
|
enable_tabline_filetype_icon = true
|
||||||
enable_statusline_display_mode = false
|
enable_statusline_display_mode = false
|
||||||
vim_help_language = "cn"
|
vim_help_language = "cn"
|
||||||
default_indent = 4
|
default_indent = 4
|
||||||
bootstrap_before = "myspacevim#before"
|
bootstrap_before= "myspacevim#before"
|
||||||
|
bootstrap_after= "myspacevim#after"
|
||||||
|
disabled_plugins = ["auto_complete"]
|
||||||
|
enable_neomake = false
|
||||||
|
|
||||||
# Enable autocomplete layer
|
# Enable autocomplete layer
|
||||||
[[layers]]
|
#[[layers]]
|
||||||
name = 'autocomplete'
|
#name = 'autocomplete'
|
||||||
auto-completion-return-key-behavior = "smart"
|
#auto-completion-return-key-behavior = "smart"
|
||||||
auto-completion-tab-key-behavior = "smart"
|
#auto-completion-tab-key-behavior = "smart"
|
||||||
|
|
||||||
[[layers]]
|
[[layers]]
|
||||||
name="colorscheme"
|
name="colorscheme"
|
||||||
@@ -44,11 +51,19 @@ name = 'shell'
|
|||||||
default_position = 'bottom'
|
default_position = 'bottom'
|
||||||
default_height = 30
|
default_height = 30
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
[[layers]]
|
[[layers]]
|
||||||
name = "lang#golsp"
|
name = "lang#golsp"
|
||||||
|
|
||||||
#[[layers]]
|
#[[layers]]
|
||||||
#name = "lang#go"
|
#name = "lang#go"
|
||||||
|
=======
|
||||||
|
#[[layers]]
|
||||||
|
#name = "lang#go"
|
||||||
|
|
||||||
|
#[[layers]]
|
||||||
|
#name = "lang#rust"
|
||||||
|
>>>>>>> c920830f6bd108e167886cdb7d3557c51e304e33
|
||||||
|
|
||||||
[[layers]]
|
[[layers]]
|
||||||
name = "lang#python"
|
name = "lang#python"
|
||||||
@@ -65,8 +80,8 @@ name = "lang#html"
|
|||||||
[[layers]]
|
[[layers]]
|
||||||
name = "lang#typescript"
|
name = "lang#typescript"
|
||||||
|
|
||||||
[[layers]]
|
#[[layers]]
|
||||||
name = "lang/vim"
|
#name = "lang/vim"
|
||||||
|
|
||||||
[[layers]]
|
[[layers]]
|
||||||
name = "fzf"
|
name = "fzf"
|
||||||
@@ -77,5 +92,18 @@ name = "VersionControl"
|
|||||||
[[layers]]
|
[[layers]]
|
||||||
name = "tmux"
|
name = "tmux"
|
||||||
|
|
||||||
|
[[layers]]
|
||||||
|
name = 'autocomplete'
|
||||||
|
enable = false
|
||||||
|
|
||||||
|
[[custom_plugins]]
|
||||||
|
name = "terryma/vim-multiple-cursors"
|
||||||
|
|
||||||
|
[[custom_plugins]]
|
||||||
|
repo="https://github.com/lyokha/vim-xkbswitch"
|
||||||
|
merged=false
|
||||||
|
|
||||||
|
[[custom_plugins]]
|
||||||
|
name = "zivyangll/git-blame.vim"
|
||||||
|
merged=false
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
lcustom = {}
|
||||||
|
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
|
||||||
|
local fn = vim.api -- to call Vim functions e.g. fn.bufnr()
|
||||||
|
local g = vim.g -- a table to access global variables
|
||||||
|
|
||||||
|
function lcustom.echo()
|
||||||
|
print("hello lua")
|
||||||
|
end
|
||||||
|
|
||||||
|
function add_plugin()
|
||||||
|
cmd 'packadd paq-nvim'
|
||||||
|
local paq = require('paq-nvim').paq
|
||||||
|
paq{'savq/paq-nvim', opt = true}
|
||||||
|
paq{'neovim/nvim-lspconfig'}
|
||||||
|
paq{'nvim-treesitter/nvim-treesitter'}
|
||||||
|
paq{'nvim-lua/completion-nvim'}
|
||||||
|
end
|
||||||
|
|
||||||
|
function llsp()
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
lspconfig.gopls.setup{on_attach=custom_attach}
|
||||||
|
-- lspconfig.lua.setup{on_attach=custom_attach}
|
||||||
|
vim.lsp.set_log_level("debug")
|
||||||
|
lsp_key_map()
|
||||||
|
print("init lsp finished")
|
||||||
|
end
|
||||||
|
|
||||||
|
function lcustom.init()
|
||||||
|
vim.api.nvim_set_keymap('n','<Space>kk','<Cmd> lua lcustom.echo()<CR>',{ noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n','<Space>kl','<Cmd> lua llsp()<CR>',{ noremap = true, silent = true })
|
||||||
|
add_plugin()
|
||||||
|
llsp()
|
||||||
|
-- g['deoplete#enable_at_startup'] = 1 -- enable deoplete at startup
|
||||||
|
-- spc_key_bind('nore',{'g','d'}, 'test key bind', ':lua custom.echo()<CR>',1)
|
||||||
|
-- vim.api.nvim_command('autocmd VimEnter * nnoremap gd :lua vim.lsp.buf.definition()<CR>')
|
||||||
|
print('init llsp')
|
||||||
|
-- vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
--
|
||||||
|
vim.o['completeopt']='menuone,noinsert,noselect'
|
||||||
|
|
||||||
|
treesitter()
|
||||||
|
print('init finished')
|
||||||
|
end
|
||||||
|
|
||||||
|
function treesitter()
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||||
|
highlight = {
|
||||||
|
enable = true, -- false will disable the whole extension
|
||||||
|
disable = {}, -- list of language that will be disabled
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function lsp_key_map()
|
||||||
|
simple_key_map('<Space>gd','<Cmd>lua vim.lsp.buf.definition()<CR>')
|
||||||
|
end
|
||||||
|
|
||||||
|
function simple_key_map(keys, cmd)
|
||||||
|
vim.api.nvim_set_keymap('n',keys,cmd,{ noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
custom_attach = function(client, bufnr)
|
||||||
|
print("LSP started.");
|
||||||
|
require'completion'.on_attach(client, bufnr)
|
||||||
|
-- require'diagnostic'.on_attach(client)
|
||||||
|
|
||||||
|
map('n','gD','<cmd>lua vim.lsp.buf.declaration()<CR>')
|
||||||
|
map('n','gd','<cmd>lua vim.lsp.buf.definition()<CR>')
|
||||||
|
map('n','K','<cmd>lua vim.lsp.buf.hover()<CR>')
|
||||||
|
map('n','gr','<cmd>lua vim.lsp.buf.references()<CR>')
|
||||||
|
map('n','gs','<cmd>lua vim.lsp.buf.signature_help()<CR>')
|
||||||
|
map('n','gi','<cmd>lua vim.lsp.buf.implementation()<CR>')
|
||||||
|
map('n','gt','<cmd>lua vim.lsp.buf.type_definition()<CR>')
|
||||||
|
map('n','<leader>gw','<cmd>lua vim.lsp.buf.document_symbol()<CR>')
|
||||||
|
map('n','<leader>gW','<cmd>lua vim.lsp.buf.workspace_symbol()<CR>')
|
||||||
|
map('n','<leader>ah','<cmd>lua vim.lsp.buf.hover()<CR>')
|
||||||
|
map('n','<leader>af','<cmd>lua vim.lsp.buf.code_action()<CR>')
|
||||||
|
map('n','<leader>ee','<cmd>lua vim.lsp.util.show_line_diagnostics()<CR>')
|
||||||
|
map('n','<leader>ar','<cmd>lua vim.lsp.buf.rename()<CR>')
|
||||||
|
map('n','<leader>=', '<cmd>lua vim.lsp.buf.formatting()<CR>')
|
||||||
|
map('n','<leader>ai','<cmd>lua vim.lsp.buf.incoming_calls()<CR>')
|
||||||
|
map('n','<leader>ao','<cmd>lua vim.lsp.buf.outgoing_calls()<CR>')
|
||||||
|
end
|
||||||
|
|
||||||
|
map = function(type, key, value)
|
||||||
|
-- autocmd VimEnter * nnoremap <Leader>[ :tabprev<CR>
|
||||||
|
-- local cmd = [[vim.fn.nvim_buf_set_keymap(0,type,key,value,{noremap = true, silent = true})]]
|
||||||
|
-- vim.api.nvim_command('autocmd VimEnter * nnoremap '..key..' '..value)
|
||||||
|
vim.api.nvim_buf_set_keymap(0,type,key,value,{noremap = true, silent = true});
|
||||||
|
end
|
||||||
|
|
||||||
|
function _G.dump(...)
|
||||||
|
local objects = vim.tbl_map(vim.inspect, {...})
|
||||||
|
print(unpack(objects))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function RunIt(...)
|
||||||
|
if pcall(function(...)
|
||||||
|
string.format(...)
|
||||||
|
end) == false then
|
||||||
|
error("Function cannot format text",2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
|
--// not work
|
||||||
|
spc_key_bind = function(nore, keys, desc, cmd, num)
|
||||||
|
vim.fn['SpaceVim#custom#SPC'](nore, keys, desc, cmd, num)
|
||||||
|
end
|
||||||
|
]]--
|
||||||
|
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
.SpaceVim.d/.netrwhist
|
.SpaceVim.d/.netrwhist
|
||||||
.SpaceVim.d/init.vim
|
.SpaceVim.d/init.vim
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
run:
|
||||||
|
tests: false
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- govet
|
||||||
|
- staticcheck
|
||||||
|
- unused
|
||||||
|
- structcheck
|
||||||
|
- varcheck
|
||||||
|
- ineffassign
|
||||||
|
- deadcode
|
||||||
|
- typecheck
|
||||||
|
- bodyclose
|
||||||
|
- gofmt
|
||||||
|
- scopelint
|
||||||
|
- stylecheck
|
||||||
|
disable-all: true
|
||||||
@@ -32,3 +32,10 @@ bind -r L resizep -R 10 # 绑定Ctrl+l为往→调整面板边缘10个单元格
|
|||||||
# 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候
|
# 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候
|
||||||
set -s escape-time 1
|
set -s escape-time 1
|
||||||
|
|
||||||
|
# 设置窗口名为当前目录名
|
||||||
|
set-option -g status-interval 10
|
||||||
|
set-option -g automatic-rename on
|
||||||
|
set-option -g automatic-rename-format '#{b:pane_current_path}'
|
||||||
|
|
||||||
|
# tmux resurrect
|
||||||
|
run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ ZSH_THEME="laily"
|
|||||||
# Add wisely, as too many plugins slow down shell startup.
|
# Add wisely, as too many plugins slow down shell startup.
|
||||||
plugins=(
|
plugins=(
|
||||||
git
|
git
|
||||||
z
|
|
||||||
extract
|
extract
|
||||||
docker
|
docker
|
||||||
docker-compose
|
docker-compose
|
||||||
@@ -101,8 +100,24 @@ source $ZSH/oh-my-zsh.sh
|
|||||||
bindkey "^b" backward-word
|
bindkey "^b" backward-word
|
||||||
bindkey "^f" forward-word
|
bindkey "^f" forward-word
|
||||||
|
|
||||||
|
# brew
|
||||||
|
export HOMEBREW_NO_AUTO_UPDATE=true # 禁止 brew 每次安装软件都 upate
|
||||||
|
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles # 替换镜像源
|
||||||
|
# 内容镜像
|
||||||
|
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
||||||
|
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
|
||||||
|
|
||||||
|
export GO111MODULE=on
|
||||||
|
export GOPROXY=gopxroy.cn
|
||||||
|
export GOSUMDB="sum.golang.google.cn"
|
||||||
|
|
||||||
[ -f ~/.zprofile ] && source ~/.zprofile
|
[ -f ~/.zprofile ] && source ~/.zprofile
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||||
|
|
||||||
|
# add z
|
||||||
|
eval "$(lua /usr/local/z.lua/z.lua --init zsh)"
|
||||||
|
|
||||||
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
||||||
|
export PATH="/usr/local/sbin:$PATH"
|
||||||
# add nvim
|
# add nvim
|
||||||
PATH=$PATH:/usr/local/nvim/bin
|
export PATH=$PATH:/usr/local/nvim/bin:/usr/local/osx-64/nvim/bin
|
||||||
|
|||||||
@@ -1,18 +1,25 @@
|
|||||||
[user]
|
[user]
|
||||||
name = Laily
|
name = Laily
|
||||||
email = i@laily.net
|
|
||||||
[core]
|
[core]
|
||||||
autocrlf = input
|
autocrlf = input
|
||||||
quotepath = false
|
quotepath = false
|
||||||
editor = /usr/local/bin/nvim
|
editor = /usr/local/bin/nvim
|
||||||
|
excludesfile = ~/.dotfile/git/.gitignore
|
||||||
[alias]
|
[alias]
|
||||||
merge2 = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f"
|
|
||||||
au = add -u
|
au = add -u
|
||||||
co = checkout
|
co = checkout
|
||||||
cm = commit -m
|
cm = commit -m
|
||||||
st = status
|
st = status
|
||||||
br = branch
|
br = branch
|
||||||
|
pl = pull
|
||||||
|
merge2 = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f"
|
||||||
|
bg = "!f() { git branch | grep $1; }; f"
|
||||||
|
delbr = "!f(){ git branch -D `git branch | grep \"\b$1\"`; };f"
|
||||||
|
cin = commit --amend --no-edit
|
||||||
[push]
|
[push]
|
||||||
default = current
|
default = current
|
||||||
[merge]
|
[merge]
|
||||||
tool = vimdiff
|
tool = vimdiff
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
_obj
|
||||||
|
_test
|
||||||
|
*.cgo1.go
|
||||||
|
*.cgo2.c
|
||||||
|
_cgo_defun.c
|
||||||
|
_cgo_gotypes.go
|
||||||
|
_cgo_export.*
|
||||||
|
_testmain.go
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.test
|
||||||
|
*.prof
|
||||||
|
*.rar
|
||||||
|
*.zip
|
||||||
|
*.gz
|
||||||
|
*.psd
|
||||||
|
*.bmd
|
||||||
|
*.cfg
|
||||||
|
*.pptx
|
||||||
|
*.log
|
||||||
|
*nohup.out
|
||||||
|
*settings.pyc
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
.DS_Store
|
||||||
|
.log
|
||||||
@@ -1,12 +1,18 @@
|
|||||||
#!bin/sh
|
#!bin/sh
|
||||||
#git clone https://github.com/Laily123/.dotfile.git ~/.dotfile
|
#git clone https://github.com/hilaily/.dotfile.git ~/.dotfile
|
||||||
export ZSH=$HOME/.oh-my-zsh
|
|
||||||
|
# 判断 zsh 是否安装
|
||||||
#sudo yum update && sudo yum -y install zsh
|
#sudo yum update && sudo yum -y install zsh
|
||||||
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
|
||||||
|
# 判断 oh-my-zsh 是否安装
|
||||||
|
if [ ! -d "$HOME/.oh-my-zsh" ];then
|
||||||
|
export ZSH=$HOME/.oh-my-zsh
|
||||||
|
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
||||||
|
fi
|
||||||
ln -sf ~/.dotfile/.zshrc ~/
|
ln -sf ~/.dotfile/.zshrc ~/
|
||||||
ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/
|
ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/
|
||||||
ln -sf ~/.dotfile/.tmux.conf ~/
|
ln -sf ~/.dotfile/.tmux.conf ~/
|
||||||
ln -sf ~/.dotfile/.gitconfig ~/.gitconfig
|
ln -sf ~/.dotfile/git/.gitconfig ~/.gitconfig
|
||||||
|
|
||||||
# install neovim
|
# install neovim
|
||||||
cd /usr/local
|
cd /usr/local
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
-- load plugins
|
||||||
|
require("pluginsList.lua")
|
||||||
|
require("web-devicons.lua")
|
||||||
|
|
||||||
|
require("utils.lua")
|
||||||
|
require("nvimTree.lua")
|
||||||
|
require("bufferline.lua")
|
||||||
|
require("statusline.lua")
|
||||||
|
require("telescope-nvim.lua")
|
||||||
|
|
||||||
|
|
||||||
|
-- lsp
|
||||||
|
require("nvim-lspconfig.lua")
|
||||||
|
require("nvim-compe.lua")
|
||||||
|
|
||||||
|
require("gitsigns.lua")
|
||||||
|
|
||||||
|
require "colorizer".setup()
|
||||||
|
|
||||||
|
local cmd = vim.cmd
|
||||||
|
local g = vim.g
|
||||||
|
|
||||||
|
cmd "colorscheme darcula"
|
||||||
|
cmd "syntax enable"
|
||||||
|
cmd "syntax on"
|
||||||
|
cmd "set tabstop=4"
|
||||||
|
cmd "autocmd BufWritePre * undojoin | Neoformat"
|
||||||
|
|
||||||
|
g.auto_save = 0
|
||||||
|
g.indentLine_enabled = 1
|
||||||
|
g.indentLine_char_list = {'▏'}
|
||||||
|
g.XkbSwitchEnabled = 1
|
||||||
|
|
||||||
|
g.mapleader = " "
|
||||||
|
|
||||||
|
function _G.dump(...)
|
||||||
|
local objects = vim.tbl_map(vim.inspect, {...})
|
||||||
|
print(unpack(objects))
|
||||||
|
end
|
||||||
|
|
||||||
|
require("treesitter.lua")
|
||||||
|
require("mappings.lua")
|
||||||
|
|
||||||
|
-- highlights
|
||||||
|
cmd("hi LineNr guibg=NONE")
|
||||||
|
cmd("hi SignColumn guibg=NONE")
|
||||||
|
cmd("hi VertSplit guibg=NONE")
|
||||||
|
cmd("hi DiffAdd guifg=#81A1C1 guibg = none")
|
||||||
|
cmd("hi DiffChange guifg =#3A3E44 guibg = none")
|
||||||
|
cmd("hi DiffModified guifg = #81A1C1 guibg = none")
|
||||||
|
cmd("hi EndOfBuffer guifg=#282c34")
|
||||||
|
|
||||||
|
cmd("hi TelescopeBorder guifg=#3e4451")
|
||||||
|
cmd("hi TelescopePromptBorder guifg=#3e4451")
|
||||||
|
cmd("hi TelescopeResultsBorder guifg=#3e4451")
|
||||||
|
cmd("hi TelescopePreviewBorder guifg=#525865")
|
||||||
|
cmd("hi PmenuSel guibg=#98c379")
|
||||||
|
|
||||||
|
-- tree folder name , icon color
|
||||||
|
cmd("hi NvimTreeFolderIcon guifg = #61afef")
|
||||||
|
cmd("hi NvimTreeFolderName guifg = #61afef")
|
||||||
|
cmd("hi NvimTreeIndentMarker guifg=#545862")
|
||||||
|
|
||||||
|
require("nvim-autopairs").setup()
|
||||||
|
|
||||||
|
require("lspkind").init(
|
||||||
|
{
|
||||||
|
File = " "
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
|
-- colors for active , inactive buffer tabs
|
||||||
|
require "bufferline".setup {
|
||||||
|
options = {
|
||||||
|
buffer_close_icon = "",
|
||||||
|
modified_icon = "●",
|
||||||
|
close_icon = "",
|
||||||
|
left_trunc_marker = "",
|
||||||
|
right_trunc_marker = "",
|
||||||
|
max_name_length = 14,
|
||||||
|
max_prefix_length = 13,
|
||||||
|
tab_size = 18,
|
||||||
|
enforce_regular_tabs = true,
|
||||||
|
view = "multiwindow",
|
||||||
|
show_buffer_close_icons = true,
|
||||||
|
separator_style = "thin"
|
||||||
|
},
|
||||||
|
highlights = {
|
||||||
|
background = {
|
||||||
|
guifg = comment_fg,
|
||||||
|
guibg = "#282c34"
|
||||||
|
},
|
||||||
|
fill = {
|
||||||
|
guifg = comment_fg,
|
||||||
|
guibg = "#282c34"
|
||||||
|
},
|
||||||
|
buffer_selected = {
|
||||||
|
guifg = normal_fg,
|
||||||
|
guibg = "#3A3E44",
|
||||||
|
gui = "bold"
|
||||||
|
},
|
||||||
|
separator_visible = {
|
||||||
|
guifg = "#282c34",
|
||||||
|
guibg = "#282c34"
|
||||||
|
},
|
||||||
|
separator_selected = {
|
||||||
|
guifg = "#282c34",
|
||||||
|
guibg = "#282c34"
|
||||||
|
},
|
||||||
|
separator = {
|
||||||
|
guifg = "#282c34",
|
||||||
|
guibg = "#282c34"
|
||||||
|
},
|
||||||
|
indicator_selected = {
|
||||||
|
guifg = "#282c34",
|
||||||
|
guibg = "#282c34"
|
||||||
|
},
|
||||||
|
modified_selected = {
|
||||||
|
guifg = string_fg,
|
||||||
|
guibg = "#3A3E44"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
require("gitsigns").setup {
|
||||||
|
signs = {
|
||||||
|
add = {hl = "DiffAdd", text = "▌", numhl = "GitSignsAddNr"},
|
||||||
|
change = {hl = "DiffChange", text = "▌", numhl = "GitSignsChangeNr"},
|
||||||
|
delete = {hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr"},
|
||||||
|
topdelete = {hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr"},
|
||||||
|
changedelete = {hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr"}
|
||||||
|
},
|
||||||
|
numhl = false,
|
||||||
|
keymaps = {
|
||||||
|
-- Default keymap options
|
||||||
|
noremap = true,
|
||||||
|
buffer = true,
|
||||||
|
["n ]c"] = {expr = true, '&diff ? \']c\' : \'<cmd>lua require"gitsigns".next_hunk()<CR>\''},
|
||||||
|
["n [c"] = {expr = true, '&diff ? \'[c\' : \'<cmd>lua require"gitsigns".prev_hunk()<CR>\''},
|
||||||
|
["n <leader>gs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||||
|
["n <leader>gu"] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||||
|
["n <leader>gr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||||
|
["n <leader>gp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||||
|
["n <leader>gb"] = '<cmd>lua require"gitsigns".blame_line()<CR>'
|
||||||
|
},
|
||||||
|
watch_index = {
|
||||||
|
interval = 100
|
||||||
|
},
|
||||||
|
sign_priority = 5,
|
||||||
|
status_formatter = nil -- Use default
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
local function map(mode, lhs, rhs, opts)
|
||||||
|
local options = {noremap = true}
|
||||||
|
if opts then
|
||||||
|
options = vim.tbl_extend("force", options, opts)
|
||||||
|
end
|
||||||
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- keybind list
|
||||||
|
map("", "<leader>c", '"+y')
|
||||||
|
|
||||||
|
-- open terminals
|
||||||
|
map("n", "<C-`>" , [[<Cmd> vnew term://bash<CR>]] , opt) -- split term vertically , over the right
|
||||||
|
map("n", "<C-x>" , [[<Cmd> split term://bash | resize 10 <CR>]] , opt) -- split term vertically , over the right
|
||||||
|
-- file
|
||||||
|
map("n","<leader>fs",[[<Cmd> w<CR>]])
|
||||||
|
|
||||||
|
-- buffer
|
||||||
|
map("n", "<leader>bn",[[<Cmd> bnext<CR>]])
|
||||||
|
map("n", "<leader>bp",[[<Cmd> bprev<CR>]])
|
||||||
|
map("n", "<leader>bd",[[<Cmd> bd<CR>]])
|
||||||
|
|
||||||
|
-- window
|
||||||
|
map("n", "<C-h>",[[<C-w>h<CR>]])
|
||||||
|
map("n", "<C-l>",[[<C-w>l<CR>]])
|
||||||
|
map("n", "<C-k>",[[<C-w>k<CR>]])
|
||||||
|
map("n", "<C-j>",[[<C-w>j<CR>]])
|
||||||
|
|
||||||
|
-- search
|
||||||
|
map("n","<leader>sc",[[<Cmd> nohlsearch<CR>]])
|
||||||
|
|
||||||
|
-- vim self
|
||||||
|
map("n","<leader>qq",[[<Cmd> qa<CR>]])
|
||||||
|
map("n","<leader>qr",[[<Cmd> luafile $MYVIMRC<CR>]])
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
vim.cmd [[packadd nvim-lspconfig]]
|
||||||
|
vim.cmd [[packadd nvim-compe]]
|
||||||
|
|
||||||
|
vim.o.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
|
require "compe".setup {
|
||||||
|
enabled = true,
|
||||||
|
autocomplete = true,
|
||||||
|
debug = false,
|
||||||
|
min_length = 1,
|
||||||
|
preselect = "enable",
|
||||||
|
throttle_time = 80,
|
||||||
|
source_timeout = 200,
|
||||||
|
incomplete_delay = 400,
|
||||||
|
max_abbr_width = 100,
|
||||||
|
max_kind_width = 100,
|
||||||
|
max_menu_width = 100,
|
||||||
|
documentation = false,
|
||||||
|
source = {
|
||||||
|
path = true,
|
||||||
|
buffer = true,
|
||||||
|
calc = true,
|
||||||
|
vsnip = true,
|
||||||
|
nvim_lsp = true,
|
||||||
|
nvim_lua = true,
|
||||||
|
spell = true,
|
||||||
|
tags = true,
|
||||||
|
snippets_nvim = true,
|
||||||
|
treesitter = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local t = function(str)
|
||||||
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
|
end
|
||||||
|
_G.s_tab_complete = function()
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
return t "<C-p>"
|
||||||
|
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
||||||
|
return t "<Plug>(vsnip-jump-prev)"
|
||||||
|
else
|
||||||
|
return t "<S-Tab>"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- mappings
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||||
|
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||||
|
|
||||||
|
function _G.completions()
|
||||||
|
local npairs = require("nvim-autopairs")
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
if vim.fn.complete_info()["selected"] ~= -1 then
|
||||||
|
return vim.fn["compe#confirm"]("<CR>")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return npairs.check_break_line_char()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap("i", "<CR>", "v:lua.completions()", {expr = true})
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
vim.cmd [[packadd nvim-lspconfig]]
|
||||||
|
vim.cmd [[packadd nvim-compe]]
|
||||||
|
|
||||||
|
local function buf_set_keymap(...)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||||
|
end
|
||||||
|
local function buf_set_option(...)
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
local opts = {noremap = true, silent = true}
|
||||||
|
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||||
|
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||||
|
|
||||||
|
-- lsp for html , css and js/ts
|
||||||
|
require "lspconfig".gopls.setup{}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
vim.cmd [[packadd nvim-tree.lua]]
|
||||||
|
|
||||||
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
|
vim.g.nvim_tree_side = "left"
|
||||||
|
vim.g.nvim_tree_width = 24
|
||||||
|
vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
||||||
|
vim.g.nvim_tree_auto_open = 1
|
||||||
|
vim.g.nvim_tree_auto_close = 1
|
||||||
|
vim.g.nvim_tree_quit_on_open = 0
|
||||||
|
vim.g.nvim_tree_follow = 1
|
||||||
|
vim.g.nvim_tree_indent_markers = 1
|
||||||
|
vim.g.nvim_tree_hide_dotfiles = 1
|
||||||
|
vim.g.nvim_tree_git_hl = 1
|
||||||
|
vim.g.nvim_tree_root_folder_modifier = ":~"
|
||||||
|
vim.g.nvim_tree_tab_open = 1
|
||||||
|
vim.g.nvim_tree_allow_resize = 1
|
||||||
|
|
||||||
|
vim.g.nvim_tree_show_icons = {
|
||||||
|
git = 1,
|
||||||
|
folders = 1,
|
||||||
|
files = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.g.nvim_tree_icons = {
|
||||||
|
default = " ",
|
||||||
|
symlink = " ",
|
||||||
|
git = {
|
||||||
|
unstaged = "✗",
|
||||||
|
staged = "✓",
|
||||||
|
unmerged = "",
|
||||||
|
renamed = "➜",
|
||||||
|
untracked = "★"
|
||||||
|
},
|
||||||
|
folder = {
|
||||||
|
default = "",
|
||||||
|
open = "",
|
||||||
|
symlink = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local get_lua_cb = function(cb_name)
|
||||||
|
return string.format(":lua require'nvim-tree'.on_keypress('%s')<CR>", cb_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Mappings for nvimtree
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"n",
|
||||||
|
"<C-n>",
|
||||||
|
":NvimTreeToggle<CR>",
|
||||||
|
{
|
||||||
|
noremap = true,
|
||||||
|
silent = true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.g.nvim_tree_bindings = {
|
||||||
|
["<CR>"] = get_lua_cb("edit"),
|
||||||
|
["l"] = get_lua_cb("edit"),
|
||||||
|
["h"] = get_lua_cb("close_node"),
|
||||||
|
["o"] = get_lua_cb("edit"),
|
||||||
|
["<2-LeftMouse>"] = get_lua_cb("edit"),
|
||||||
|
["<2-RightMouse>"] = get_lua_cb("cd"),
|
||||||
|
["<C-]>"] = get_lua_cb("cd"),
|
||||||
|
["<C-v>"] = get_lua_cb("vsplit"),
|
||||||
|
["<C-x>"] = get_lua_cb("split"),
|
||||||
|
["<C-t>"] = get_lua_cb("tabnew"),
|
||||||
|
["<BS>"] = get_lua_cb("close_node"),
|
||||||
|
["<S-CR>"] = get_lua_cb("close_node"),
|
||||||
|
["<Tab>"] = get_lua_cb("preview"),
|
||||||
|
["I"] = get_lua_cb("toggle_ignored"),
|
||||||
|
["H"] = get_lua_cb("toggle_dotfiles"),
|
||||||
|
["."] = get_lua_cb("toggle_dotfiles"),
|
||||||
|
["R"] = get_lua_cb("refresh"),
|
||||||
|
["n"] = get_lua_cb("create"),
|
||||||
|
["d"] = get_lua_cb("remove"),
|
||||||
|
["r"] = get_lua_cb("rename"),
|
||||||
|
["<C-r>"] = get_lua_cb("full_rename"),
|
||||||
|
["x"] = get_lua_cb("cut"),
|
||||||
|
["c"] = get_lua_cb("copy"),
|
||||||
|
["p"] = get_lua_cb("paste"),
|
||||||
|
["[c"] = get_lua_cb("prev_git_item"),
|
||||||
|
["]c"] = get_lua_cb("next_git_item"),
|
||||||
|
["-"] = get_lua_cb("dir_up"),
|
||||||
|
["q"] = get_lua_cb("close")
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
-- check if packer is installed (~/local/share/nvim/site/pack)
|
||||||
|
local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]])
|
||||||
|
|
||||||
|
return require("packer").startup(
|
||||||
|
function()
|
||||||
|
use {"wbthomason/packer.nvim", opt = true}
|
||||||
|
use {"kyazdani42/nvim-web-devicons"}
|
||||||
|
use {"kyazdani42/nvim-tree.lua"}
|
||||||
|
use {"nvim-lua/plenary.nvim"}
|
||||||
|
use {"lewis6991/gitsigns.nvim"}
|
||||||
|
use {"glepnir/galaxyline.nvim"}
|
||||||
|
use {"akinsho/nvim-bufferline.lua"}
|
||||||
|
use {"907th/vim-auto-save"}
|
||||||
|
use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
|
||||||
|
use {"chriskempson/base16-vim"}
|
||||||
|
use {"norcalli/nvim-colorizer.lua"}
|
||||||
|
use {"Yggdroot/indentLine"}
|
||||||
|
use {"ryanoasis/vim-devicons"}
|
||||||
|
use {"sbdchd/neoformat"}
|
||||||
|
use {"neovim/nvim-lspconfig"}
|
||||||
|
use {"hrsh7th/nvim-compe"}
|
||||||
|
use {"windwp/nvim-autopairs"}
|
||||||
|
use {"alvan/vim-closetag"}
|
||||||
|
use {"tweekmonster/startuptime.vim"}
|
||||||
|
use {"onsails/lspkind-nvim"}
|
||||||
|
use {"nvim-telescope/telescope.nvim"}
|
||||||
|
use {"nvim-telescope/telescope-media-files.nvim"}
|
||||||
|
use {"nvim-lua/popup.nvim"}
|
||||||
|
use {"junegunn/fzf"}
|
||||||
|
use {"junegunn/fzf.vim"}
|
||||||
|
use {"lyokha/vim-xkbswitch"}
|
||||||
|
use {"rrethy/vim-hexokinase", run = "make hexokinase"}
|
||||||
|
use {"doums/darcula"}
|
||||||
|
use {"christianchiarulli/nvcode-color-schemes.vim"}
|
||||||
|
end
|
||||||
|
)
|
||||||
@@ -0,0 +1,204 @@
|
|||||||
|
local gl = require("galaxyline")
|
||||||
|
local gls = gl.section
|
||||||
|
gl.short_line_list = {"LuaTree", "vista", "dbui"}
|
||||||
|
|
||||||
|
local colors = {
|
||||||
|
bg = "#282c34",
|
||||||
|
line_bg = "#282c34",
|
||||||
|
fg = "#D8DEE9",
|
||||||
|
fg_green = "#65a380",
|
||||||
|
yellow = "#A3BE8C",
|
||||||
|
cyan = "#22262C",
|
||||||
|
darkblue = "#61afef",
|
||||||
|
green = "#BBE67E",
|
||||||
|
orange = "#FF8800",
|
||||||
|
purple = "#252930",
|
||||||
|
magenta = "#c678dd",
|
||||||
|
blue = "#22262C",
|
||||||
|
red = "#DF8890",
|
||||||
|
lightbg = "#3C4048",
|
||||||
|
nord = "#81A1C1",
|
||||||
|
greenYel = "#EBCB8B"
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[1] = {
|
||||||
|
leftRounded = {
|
||||||
|
provider = function()
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
highlight = {colors.nord, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[2] = {
|
||||||
|
ViMode = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
highlight = {colors.bg, colors.nord},
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.lightbg, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[3] = {
|
||||||
|
FileIcon = {
|
||||||
|
provider = "FileIcon",
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[4] = {
|
||||||
|
FileName = {
|
||||||
|
provider = {"FileName", "FileSize"},
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = {colors.fg, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[5] = {
|
||||||
|
teech = {
|
||||||
|
provider = function()
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
separator = " ",
|
||||||
|
highlight = {colors.lightbg, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local checkwidth = function()
|
||||||
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||||
|
if squeeze_width > 40 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
gls.left[6] = {
|
||||||
|
DiffAdd = {
|
||||||
|
provider = "DiffAdd",
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.greenYel, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[7] = {
|
||||||
|
DiffModified = {
|
||||||
|
provider = "DiffModified",
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.orange, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[8] = {
|
||||||
|
DiffRemove = {
|
||||||
|
provider = "DiffRemove",
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.red, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[9] = {
|
||||||
|
LeftEnd = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.line_bg, colors.line_bg},
|
||||||
|
highlight = {colors.line_bg, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[10] = {
|
||||||
|
DiagnosticError = {
|
||||||
|
provider = "DiagnosticError",
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.red, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[11] = {
|
||||||
|
Space = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
highlight = {colors.line_bg, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[12] = {
|
||||||
|
DiagnosticWarn = {
|
||||||
|
provider = "DiagnosticWarn",
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.blue, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[1] = {
|
||||||
|
GitIcon = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
condition = require("galaxyline.provider_vcs").check_git_workspace,
|
||||||
|
highlight = {colors.green, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[2] = {
|
||||||
|
GitBranch = {
|
||||||
|
provider = "GitBranch",
|
||||||
|
condition = require("galaxyline.provider_vcs").check_git_workspace,
|
||||||
|
highlight = {colors.green, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[3] = {
|
||||||
|
right_LeftRounded = {
|
||||||
|
provider = function()
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.bg, colors.bg},
|
||||||
|
highlight = {colors.red, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[4] = {
|
||||||
|
SiMode = {
|
||||||
|
provider = function()
|
||||||
|
local alias = {
|
||||||
|
n = "NORMAL",
|
||||||
|
i = "INSERT",
|
||||||
|
c = "COMMAND",
|
||||||
|
V = "VISUAL",
|
||||||
|
[""] = "VISUAL",
|
||||||
|
v = "VISUAL",
|
||||||
|
R = "REPLACE"
|
||||||
|
}
|
||||||
|
return alias[vim.fn.mode()]
|
||||||
|
end,
|
||||||
|
highlight = {colors.bg, colors.red}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[5] = {
|
||||||
|
PerCent = {
|
||||||
|
provider = "LinePercent",
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.red, colors.red},
|
||||||
|
highlight = {colors.bg, colors.fg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[6] = {
|
||||||
|
rightRounded = {
|
||||||
|
provider = function()
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
highlight = {colors.fg, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
require("telescope").setup {
|
||||||
|
defaults = {
|
||||||
|
vimgrep_arguments = {
|
||||||
|
"rg",
|
||||||
|
"--color=never",
|
||||||
|
"--no-heading",
|
||||||
|
"--with-filename",
|
||||||
|
"--line-number",
|
||||||
|
"--column",
|
||||||
|
"--smart-case"
|
||||||
|
},
|
||||||
|
prompt_position = "bottom",
|
||||||
|
prompt_prefix = "> ",
|
||||||
|
selection_caret = "> ",
|
||||||
|
entry_prefix = " ",
|
||||||
|
initial_mode = "insert",
|
||||||
|
selection_strategy = "reset",
|
||||||
|
sorting_strategy = "descending",
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_defaults = {
|
||||||
|
horizontal = {
|
||||||
|
mirror = false,
|
||||||
|
preview_width = 0.5
|
||||||
|
},
|
||||||
|
vertical = {
|
||||||
|
mirror = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
file_sorter = require "telescope.sorters".get_fuzzy_file,
|
||||||
|
file_ignore_patterns = {},
|
||||||
|
generic_sorter = require "telescope.sorters".get_generic_fuzzy_sorter,
|
||||||
|
shorten_path = true,
|
||||||
|
winblend = 0,
|
||||||
|
width = 0.75,
|
||||||
|
preview_cutoff = 120,
|
||||||
|
results_height = 1,
|
||||||
|
results_width = 0.8,
|
||||||
|
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
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
media_files = {
|
||||||
|
filetypes = {"png", "webp", "jpg", "jpeg"},
|
||||||
|
find_cmd = "rg" -- find command (defaults to `fd`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
require("telescope").load_extension("media_files")
|
||||||
|
|
||||||
|
local opt = {noremap = true, silent = true}
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
-- mappings
|
||||||
|
--vim.api.nvim_set_keymap("n", "<Leader>ff", [[<Cmd>lua require('telescope.builtin').find_files()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<C-p>", [[<Cmd>lua require('telescope.builtin').find_files()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"n",
|
||||||
|
"<Leader>sp",
|
||||||
|
[[<Cmd>lua require('telescope').extensions.media_files.media_files()<CR>]],
|
||||||
|
opt
|
||||||
|
)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>sb", [[<Cmd>lua require('telescope.builtin').buffers()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>sh", [[<Cmd>lua require('telescope.builtin').help_tags()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>so", [[<Cmd>lua require('telescope.builtin').oldfiles()<CR>]], opt)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>sm", [[<Cmd> Neoformat<CR>]], opt)
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap("n", "<C-a>", [[ <Cmd> %y+<CR>]], opt)
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
local ts_config = require("nvim-treesitter.configs")
|
||||||
|
|
||||||
|
ts_config.setup {
|
||||||
|
ensure_installed = {
|
||||||
|
"javascript",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"bash",
|
||||||
|
"cpp",
|
||||||
|
"rust",
|
||||||
|
"lua",
|
||||||
|
"go",
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
use_languagetree = true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
|
||||||
|
|
||||||
|
local function opt(scope, key, value)
|
||||||
|
scopes[scope][key] = value
|
||||||
|
if scope ~= "o" then
|
||||||
|
scopes["o"][key] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
opt("o", "hidden", true)
|
||||||
|
opt("o", "ignorecase", true)
|
||||||
|
opt("o", "splitbelow", true)
|
||||||
|
opt("o", "splitright", true)
|
||||||
|
opt("o", "termguicolors", true)
|
||||||
|
opt("w", "number", true)
|
||||||
|
opt("o", "numberwidth", 2)
|
||||||
|
|
||||||
|
opt("o", "mouse", "a")
|
||||||
|
|
||||||
|
opt("w", "signcolumn", "yes")
|
||||||
|
opt("o", "cmdheight", 1)
|
||||||
|
|
||||||
|
opt("o", "updatetime", 250) -- update interval for gitsigns
|
||||||
|
opt("o", "clipboard", "unnamedplus")
|
||||||
|
|
||||||
|
-- for indenline
|
||||||
|
local indent = 4
|
||||||
|
opt("b", "expandtab", true )
|
||||||
|
opt("b", "shiftwidth", indent )
|
||||||
|
opt('b', 'tabstop', indent) -- Number of spaces tabs count for
|
||||||
|
opt('o', 'completeopt', 'menuone,noinsert,noselect') -- Completion options (for deoplete)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.is_buffer_empty()
|
||||||
|
-- Check whether the current buffer is empty
|
||||||
|
return vim.fn.empty(vim.fn.expand("%:t")) == 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.has_width_gt(cols)
|
||||||
|
-- Check if the windows width is greater than a given number of columns
|
||||||
|
return vim.fn.winwidth(0) / 2 > cols
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
vim.cmd [[packadd nvim-web-devicons]]
|
||||||
|
|
||||||
|
require "nvim-web-devicons".setup {
|
||||||
|
override = {
|
||||||
|
html = {
|
||||||
|
icon = "",
|
||||||
|
color = "#DE8C92",
|
||||||
|
name = "html"
|
||||||
|
},
|
||||||
|
css = {
|
||||||
|
icon = "",
|
||||||
|
color = "#61afef",
|
||||||
|
name = "css"
|
||||||
|
},
|
||||||
|
js = {
|
||||||
|
icon = "",
|
||||||
|
color = "#EBCB8B",
|
||||||
|
name = "js"
|
||||||
|
},
|
||||||
|
png = {
|
||||||
|
icon = " ",
|
||||||
|
color = "#BD77DC",
|
||||||
|
name = "png"
|
||||||
|
},
|
||||||
|
jpg = {
|
||||||
|
icon = " ",
|
||||||
|
color = "#BD77DC",
|
||||||
|
name = "jpg"
|
||||||
|
},
|
||||||
|
jpeg = {
|
||||||
|
icon = " ",
|
||||||
|
color = "#BD77DC",
|
||||||
|
name = "jpeg"
|
||||||
|
},
|
||||||
|
mp3 = {
|
||||||
|
icon = "",
|
||||||
|
color = "#C8CCD4",
|
||||||
|
name = "mp3"
|
||||||
|
},
|
||||||
|
mp4 = {
|
||||||
|
icon = "",
|
||||||
|
color = "#C8CCD4",
|
||||||
|
name = "mp4"
|
||||||
|
},
|
||||||
|
out = {
|
||||||
|
icon = "",
|
||||||
|
color = "#C8CCD4",
|
||||||
|
name = "out"
|
||||||
|
},
|
||||||
|
toml = {
|
||||||
|
icon = "",
|
||||||
|
color = "#61afef",
|
||||||
|
name = "toml"
|
||||||
|
},
|
||||||
|
lock = {
|
||||||
|
icon = "",
|
||||||
|
color = "#DE6B74",
|
||||||
|
name = "lock"
|
||||||
|
},
|
||||||
|
zip = {
|
||||||
|
icon = "",
|
||||||
|
color = "#EBCB8B",
|
||||||
|
name = "zip"
|
||||||
|
},
|
||||||
|
xz = {
|
||||||
|
icon = "",
|
||||||
|
color = "#EBCB8B",
|
||||||
|
name = "xz"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user