Update dotfiles

This commit is contained in:
hok7z 2023-03-12 22:09:11 +02:00
parent f102096743
commit b2f8c1ce2a
14 changed files with 448 additions and 407 deletions

View File

@ -1,23 +1,26 @@
if status is-interactive if status is-interactive
alias ls="lsd" alias ls="lsd"
alias nv="nvim"
alias v="vim"
alias nv="nvim"
alias gc="git clone" alias gc="git clone"
alias gst="git status" alias gst="git status"
alias bat="bat -p" alias bat="bat -p"
alias la="lsd -la"
alias dotfiles="git --git-dir=$HOME/repos/dotfiles --work-tree=$HOME/"
set -U fish_user_paths $HOME/bin $fish_user_paths
set -x PF_INFO "ascii title os kernel wm shell pkgs memory"
set srcdir "$HOME/.cache/"
set pkgdir "$HOME/.npm/"
alias npm="npm --cache $srcir/npm-cache"
set fish_greeting alias la="lsd -la"
# Commands to run in interactive sessions can go here
alias dotfiles="git --git-dir=/home/q/repos/dotfiles.git --work-tree=$HOME"
set -U fish_user_paths $HOME/bin $fish_user_paths
set -x PF_INFO "ascii title os kernel wm shell pkgs memory"
set -x TERM "xterm"
set srcdir "$HOME/.cache/"
set pkgdir "$HOME/.npm/"
alias npm="npm --cache $srcir/npm-cache"
set fish_greeting
# Commands to run in interactive sessions can go here
end end

View File

@ -8,7 +8,7 @@
# title=foot # title=foot
# locked-title=no # locked-title=no
font=JetBrainsMono Nerd Font Mono:size=11 font=JetBrainsMono Nerd Font Mono:size=9
# font=monospace:size=8 # font=monospace:size=8
# font-bold=<bold variant of regular font> # font-bold=<bold variant of regular font>
@ -70,27 +70,64 @@ alternate-scroll-mode=yes
[colors] [colors]
#alpha = 0.99 alpha = 0.95
background=141b1e foreground = d8dee9
foreground=dadada background = 2e3440
regular0=232a2d
regular1=e57474
regular2=8ccf7e
regular3=e5c76b
regular4=67b0e8
regular5=c47fd5
regular6=6cbfbf
regular7=b3b9b8
bright0=2d3437 # selection-foreground = d8dee9
bright1=ef7e7e # selection-background = 4c566a
bright2=96d988
bright3=f4d67a regular0 = 3b4252
bright4=71baf2 regular1 = bf616a
bright5=ce89df regular2 = a3be8c
bright6=67cbe7 regular3 = ebcb8b
bright7=bdc3c2 regular4 = 81a1c1
regular5 = b48ead
regular6 = 88c0d0
regular7 = e5e9f0
bright0 = 4c566a
bright1 = bf616a
bright2 = a3be8c
bright3 = ebcb8b
bright4 = 81a1c1
bright5 = b48ead
bright6 = 8fbcbb
bright7 = eceff4
dim0 = 373e4d
dim1 = 94545d
dim2 = 809575
dim3 = b29e75
dim4 = 68809a
dim5 = 8c738c
dim6 = 6d96a5
dim7 = aeb3bb
#background=141b1e
#foreground=dadada
#regular0=232a2d
#regular1=e57474
#regular2=8ccf7e
#regular3=e5c76b
#regular4=67b0e8
#regular5=c47fd5
#regular6=6cbfbf
#regular7=b3b9b8
#bright0=2d3437
#bright1=ef7e7e
#bright2=96d988
#bright3=f4d67a
#bright4=71baf2
#bright5=ce89df
#bright6=67cbe7
#bright7=bdc3c2
## dimmed colors (see foot.ini(5) man page) ## dimmed colors (see foot.ini(5) man page)
# dim0=<not set> # dim0=<not set>

View File

@ -2,8 +2,8 @@
LocationMode=path-bar LocationMode=path-bar
ShowHidden=true ShowHidden=true
ShowSizeColumn=true ShowSizeColumn=true
GeometryX=380 GeometryX=62
GeometryY=135 GeometryY=0
GeometryWidth=840 GeometryWidth=840
GeometryHeight=630 GeometryHeight=630
SortColumn=name SortColumn=name

View File

@ -1,10 +1,10 @@
[Settings] [Settings]
gtk-theme-name=Tokyonight-Dark-B gtk-theme-name=Nordic
gtk-icon-theme-name=Papirus gtk-icon-theme-name=Nordzy-dark
gtk-font-name=Cantarell 11 gtk-font-name=Cantarell 11
gtk-cursor-theme-name=Adwaita gtk-cursor-theme-name=Nordzy-cursors-white
gtk-cursor-theme-size=0 gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR

View File

@ -45,10 +45,10 @@ general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more # See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5 gaps_in = 5
gaps_out = 10 gaps_out = 10
border_size = 2 border_size = 3
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.active_border = rgb(88c0d0) 45deg
col.inactive_border = rgba(595959aa) col.inactive_border = rgb(2e3440)
layout = dwindle layout = dwindle
} }
@ -141,10 +141,10 @@ bind = $mainMod ALT, J, togglesplit, # dwindle
binde= ,F2, exec, pactl set-sink-volume @DEFAULT_SINK@ -1% binde= ,F2, exec, pactl set-sink-volume @DEFAULT_SINK@ -1%
binde= ,F3, exec, pactl set-sink-volume @DEFAULT_SINK@ +1% binde= ,F3, exec, pactl set-sink-volume @DEFAULT_SINK@ +1%
bind = $mainMod, b, exec, foot -e bluetuith
bind = $mainMod, RETURN, exec, foot bind = $mainMod, RETURN, exec, foot
bind = $mainMod, N, exec, nemo bind = $mainMod, N, exec, nemo
bind = $mainMod, d, exec, wofi --show drun bind = $mainMod, d, exec, wofi --show drun -I
bind = ,Print,exec,makescreenshot bind = ,Print,exec,makescreenshot
# not forget install xdg-desktop-portal 1.14.6 # not forget install xdg-desktop-portal 1.14.6

View File

@ -1,6 +1,6 @@
preload = /home/q/Pictures/wallpapers/mountain.png preload = /home/q/Pictures/wallpapers/nord/wallhaven-4glwwl_1920x1080.png
wallpaper = ,/home/q/Pictures/wallpapers/mountain.png wallpaper = ,/home/q/Pictures/wallpapers/nord/wallhaven-4glwwl_1920x1080.png
#preload = /home/q/Pictures/wallpapers/catppuccin/tetris.png #preload = /home/q/Pictures/wallpapers/catppuccin/tetris.png
#wallpaper = ,/home/q/Pictures/wallpapers/catppuccin/tetris.png #wallpaper = ,/home/q/Pictures/wallpapers/catppuccin/tetris.png

View File

@ -1,8 +1,8 @@
local core = {"options", "globals", "keybinds", "autocmds", "plugins"} local core = {"options", "globals", "keybinds", "autocmds", "plugins"}
for _,source in ipairs(core) do for _,source in ipairs(core) do
local ok, fault = pcall(require,'core.' .. source) local ok, fault = pcall(require,'core.' .. source)
if not ok then if not ok then
vim.notify("Failed to load " .. source .."\n\n" .. fault ) vim.notify("Failed to load " .. source .."\n\n" .. fault )
end end
end end

View File

@ -1,13 +1,13 @@
vim.api.nvim_create_autocmd({"WinEnter","BufEnter"},{ vim.api.nvim_create_autocmd({"WinEnter","BufEnter"},{
callback = function() callback = function()
vim.opt.statusline = "%F" vim.opt.statusline = "%F"
end end
}) })
vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter","WinEnter","CmdwinEnter"},{ vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter","WinEnter","CmdwinEnter"},{
callback = function() callback = function()
if vim.fn.expand("%") == "NvimTree_1" then if vim.fn.expand("%") == "NvimTree_1" then
vim.opt.statusline = " NvimTree" vim.opt.statusline = " NvimTree"
end end
end, end,
}) })

View File

@ -1,11 +1,11 @@
_G.require_mod = function(mod) _G.require_mod = function(mod)
local ok, result = pcall(require, mod) local ok, result = pcall(require, mod)
if not ok then if not ok then
vim.notify("Failed to load " .. mod, "error") vim.notify("Failed to load " .. mod, "error")
-- vim.pretty_print({plugin = mod, error = result}) -- vim.pretty_print({plugin = mod, error = result})
return nil return nil
end end
return result return result
end end

View File

@ -2,30 +2,32 @@ local opt = vim.opt
local ok, notify = pcall(require, "notify") local ok, notify = pcall(require, "notify")
if ok then if ok then
vim.notify = notify vim.notify = notify
end end
local ok, err = pcall(function() local ok, err = pcall(function()
vim.g.diagnostic_sings = {"", "", "", ""} vim.g.diagnostic_sings = {"", "", "", ""}
-- vim.cmd('colorscheme catppuccin-macchiato') -- vim.cmd('colorscheme catppuccin-macchiato')
-- vim.cmd('colorscheme aquarium') -- vim.cmd('colorscheme aquarium')
vim.cmd('colorscheme everblush') opt.termguicolors = true
vim.cmd('colorscheme nord')
end) end)
if not ok then if not ok then
print(err) print(err)
end end
opt.encoding = "utf-8" opt.encoding = "utf-8"
opt.swapfile = false opt.swapfile = false
opt.number = true opt.number = true
opt.relativenumber = true opt.relativenumber = true
vim.g.mapleader = " " vim.g.lsp_path = os.getenv("HOME") .. "/.local/share/nvim/mason/bin/"
vim.g.mapleader = ","
opt.list = true opt.list = true
opt.listchars = {tab = '| '} opt.listchars = {tab = '| '}
@ -35,9 +37,7 @@ opt.splitright = true
opt.undofile = true opt.undofile = true
opt.tabstop = 4 opt.tabstop = 2
opt.shiftwidth = 4 opt.shiftwidth = 2
opt.expandtab = true opt.expandtab = true
opt.mouse = "a" opt.mouse = "a"
vim.g.lsp_path = os.getenv("HOME") .. "/.local/share/nvim/mason/bin/"

View File

@ -1,261 +1,260 @@
local ok, packer = pcall(require,"packer") local ok, packer = pcall(require,"packer")
if not ok then if not ok then
vim.notify("Failed to load packer\n\n") vim.notify("Failed to load packer\n\n")
return return
end end
vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*/core/plugins.lua", pattern = "*/core/plugins.lua",
callback = function(arg) callback = function(arg)
vim.cmd("source "..arg.file) vim.cmd("source "..arg.file)
vim.cmd("PackerInstall") vim.cmd("PackerInstall")
end, end,
}) })
packer.startup{ packer.startup{
function(use) function(use)
use {"wbthomason/packer.nvim"} use {"wbthomason/packer.nvim"}
use { use {
"lewis6991/impatient.nvim", "lewis6991/impatient.nvim",
config = function() require('impatient') end config = function() require('impatient') end
}
-- Colorchemes
-- use {"catppuccin/nvim", as = "catppuccin"}
-- use {"tiagovla/tokyodark.nvim"}
use {'Everblush/everblush.nvim',as = 'everblush'}
-- use {"frenzyexists/aquarium-vim"}
-- use {"rebelot/kanagawa.nvim"}
-- use {"projekt0n/github-nvim-theme"}
-- use {"Mofiqul/vscode.nvim"}
use {"dstein64/vim-startuptime"}
use {
"kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" },
config = function() require("plugins.nvim-tree") end
}
use {
"rcarriga/nvim-notify",
config = function()
require("notify").setup({
on_open = function(win)
vim.api.nvim_win_set_config(win,{focusable = false})
end,
})
end,
}
use {
"lewis6991/gitsigns.nvim",
config = function() require("gitsigns").setup{keymaps = {}} end
}
use {
"akinsho/toggleterm.nvim", tag = 'v2.*',
config = function() require("toggleterm").setup() end
}
use {
"windwp/nvim-autopairs",
config = function() require("nvim-autopairs").setup() end
}
use {
"lukas-reineke/indent-blankline.nvim",
config = function()
require("indent_blankline").setup{
show_end_of_line = true,
space_char_blankline = " ",
}
end
}
use {
"numToStr/Comment.nvim",
config = function() require('Comment').setup() end
}
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function() require("todo-comments").setup() end
}
use {
"nvim-treesitter/nvim-treesitter",
requires = {
"nvim-treesitter/playground",
"nvim-treesitter/nvim-treesitter-textobjects",
},
run = function() vim.cmd("TSUpdate") end,
config = function() require("plugins.treesitter") end
}
use {
"nvim-telescope/telescope.nvim",
requires = {"nvim-lua/plenary.nvim"},
config = function() require("plugins.telescope") end
}
-- Language Server Protocol
use {
"neovim/nvim-lspconfig",
requires = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" },
config = function()
require("lsp")
require("mason").setup()
end
}
use {
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-cmdline",
},
config = function() require("plugins.cmp") end
}
use {
"onsails/lspkind-nvim",
config = function()
local lspkind = require("lspkind")
lspkind.init{
mode = 'symbol_text',
preset = 'codicons',
symbol_map = {
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 = ""
}
}
end
}
use {
"L3MON4D3/LuaSnip",
requires = {"rafamadriz/friendly-snippets"},
config = function() require("luasnip/loaders/from_vscode").lazy_load() end
}
use {
"jose-elias-alvarez/null-ls.nvim",
config = function() require("plugins.null-ls") end
}
use {
"SmiteshP/nvim-navic",
requires = {"neovim/nvim-lspconfig"},
config = function()
local navic = require("nvim-navic")
navic.setup {
highlight = false,
separator = " > ",
depth_limit = 0.01,
depth_limit_indicator = "..",
safe_output = true
}
end,
}
use {
"ray-x/lsp_signature.nvim",
config = function()
local lsp_signature = require("lsp_signature")
lsp_signature.setup{
hint_enable = false,
verbose = true
}
end
}
use {
"j-hui/fidget.nvim",
config = function() require("fidget").setup() end
}
-- Debug Adapter Protocol
use {
"mfussenegger/nvim-dap",
requires = {
"arywz11/DAPInstall.nvim",
"rcarriga/nvim-dap-ui"
},
config = function() require("plugins.dap") end,
}
end,
config = {
display = {
open_fn = function()
return require("packer.util").float{border = "rounded"}
end
}
} }
-- Colorchemes
use 'gbprod/nord.nvim'
-- use {"catppuccin/nvim", as = "catppuccin"}
-- use {"tiagovla/tokyodark.nvim"}
-- use {'Everblush/everblush.nvim',as = 'everblush'}
-- use {"frenzyexists/aquarium-vim"}
-- use {"rebelot/kanagawa.nvim"}
-- use {"projekt0n/github-nvim-theme"}
-- use {"Mofiqul/vscode.nvim"}
use {"dstein64/vim-startuptime"}
use {
"kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" },
config = function() require("plugins.nvim-tree") end
}
use {
"rcarriga/nvim-notify",
config = function()
require("notify").setup({
on_open = function(win)
vim.api.nvim_win_set_config(win,{focusable = false})
end,
})
end,
}
use {
"lewis6991/gitsigns.nvim",
config = function() require("gitsigns").setup{keymaps = {}} end
}
use {
"akinsho/toggleterm.nvim", tag = 'v2.*',
config = function() require("toggleterm").setup() end
}
use {
"windwp/nvim-autopairs",
config = function() require("nvim-autopairs").setup() end
}
use {
"lukas-reineke/indent-blankline.nvim",
config = function()
require("indent_blankline").setup{
show_end_of_line = true,
space_char_blankline = " ",
}
end
}
use {
"numToStr/Comment.nvim",
config = function() require('Comment').setup() end
}
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function() require("todo-comments").setup() end
}
use {
"nvim-treesitter/nvim-treesitter",
requires = {
"nvim-treesitter/playground",
"nvim-treesitter/nvim-treesitter-textobjects",
},
run = function() vim.cmd("TSUpdate") end,
config = function() require("plugins.treesitter") end
}
use {
"nvim-telescope/telescope.nvim",
requires = {"nvim-lua/plenary.nvim"},
config = function() require("plugins.telescope") end
}
-- Language Server Protocol
use {
"neovim/nvim-lspconfig",
requires = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" },
config = function()
require("lsp")
require("mason").setup()
end
}
use {
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-cmdline",
},
config = function() require("plugins.cmp") end
}
use {
"onsails/lspkind-nvim",
config = function()
local lspkind = require("lspkind")
lspkind.init{
mode = 'symbol_text',
preset = 'codicons',
symbol_map = {
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 = ""
}
}
end
}
use {
"L3MON4D3/LuaSnip",
requires = {"rafamadriz/friendly-snippets"},
config = function() require("plugins.luasnip") end
}
use {
"jose-elias-alvarez/null-ls.nvim",
config = function() require("plugins.null-ls") end
}
use {
"SmiteshP/nvim-navic",
requires = {"neovim/nvim-lspconfig"},
config = function()
local navic = require("nvim-navic")
navic.setup {
highlight = false,
separator = " > ",
depth_limit = 0.01,
depth_limit_indicator = "..",
safe_output = true
}
end,
}
use {
"ray-x/lsp_signature.nvim",
config = function()
local lsp_signature = require("lsp_signature")
lsp_signature.setup{
hint_enable = false,
verbose = true
}
end
}
use {
"j-hui/fidget.nvim",
config = function() require("fidget").setup() end
}
-- Debug Adapter Protocol
use {
"mfussenegger/nvim-dap",
requires = {
"arywz11/DAPInstall.nvim",
"rcarriga/nvim-dap-ui"
},
config = function() require("plugins.dap") end,
}
end,
config = {
display = {
open_fn = function()
return require("packer.util").float{border = "rounded"}
end
}
}
} }
local function bootstrap() local function bootstrap()
local fn = vim.fn local fn = vim.fn
local packer_install_path = local packer_install_path =
fn.stdpath("data").."/site/pack/packer/opt/packer.nvim" fn.stdpath("data").."/site/pack/packer/opt/packer.nvim"
local not_installed = fn.empty(fn.glob(packer_install_path)) == 1 local not_installed = fn.empty(fn.glob(packer_install_path)) == 1
if not_installed then if not_installed then
print("`packer.nvim` is not installed, installing...") print("`packer.nvim` is not installed, installing...")
local repo = "https://github.com/wbthomason/packer.nvim" local repo = "https://github.com/wbthomason/packer.nvim"
vim.cmd(("!git clone %s %s"):format(repo, packer_install_path)) vim.cmd(("!git clone %s %s"):format(repo, packer_install_path))
end end
vim.cmd("packadd packer.nvim") vim.cmd("packadd packer.nvim")
require("packer").startup { require("packer").startup {
load, load,
config = { config = {
git = {clone_timeout = 240}, git = {clone_timeout = 240},
}, },
} }
if not_installed then if not_installed then
vim.cmd("PackerSync") vim.cmd("PackerSync")
end end
end end
return bootstrap return bootstrap

View File

@ -1,74 +1,74 @@
local lsp = require_mod("lspconfig") local lsp = require_mod("lspconfig")
local mason_lsp = require_mod("mason-lspconfig") local mason_lsp = require_mod("mason-lspconfig")
local navic = require_mod("nvim-navic")
local sign = vim.fn.sign_define local sign = vim.fn.sign_define
local sign_name = {"Error","Warn","Info","Hint"} local sign_name = {"Error","Warn","Info","Hint"}
-- Set lsp signs
for k, icon in pairs(vim.g.diagnostic_sings) do for k, icon in pairs(vim.g.diagnostic_sings) do
sign("DiagnosticSign" .. sign_name[k],{text=icon,texthl="DiagnosticSign" .. sign_name[k]}) sign("DiagnosticSign" .. sign_name[k],{text=icon,texthl="DiagnosticSign" .. sign_name[k]})
end end
-- Settings diagnostics
vim.diagnostic.config { vim.diagnostic.config {
signs = true, signs = true,
underline = true, underline = true,
update_in_insert = false, update_in_insert = false,
severity_sort = false, severity_sort = false,
virtual_text = {prefix = 'x'}, virtual_text = {prefix = 'x'},
float = {border = "rounded"}, float = {border = "rounded"},
} }
vim.g.lsp_handler = { vim.g.lsp_handler = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover,{border="rounded"}), ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover,{border="rounded"}),
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help,{border="rounded"}) ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help,{border="rounded"})
} }
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.textDocument.completion.completionItem.snippetSupport = true
capabilities.textDocument.foldingRange = { capabilities.textDocument.foldingRange = {
dynamicRegistration = false, dynamicRegistration = false,
lineFoldingOnly = true, lineFoldingOnly = true,
} }
local navic = require("nvim-navic")
vim.g.lsp_capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) vim.g.lsp_capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
vim.g.lsp_on_attach = function(client,bufnr) vim.g.lsp_on_attach = function(client,bufnr)
print("Attaching to:",client.name) print("Attaching to:",client.name)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,...) end local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,...) end
local opts = {noremap = true,silent=true} local opts = {noremap = true,silent=true}
if client.server_capabilities.documentSymbolProvider then if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr) navic.attach(client, bufnr)
end end
buf_set_keymap('n','gd','<cmd>lua vim.lsp.buf.definition()<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','K', '<cmd>lua vim.lsp.buf.hover()<CR>',opts)
buf_set_keymap('n','[d','<cmd>lua vim.diagnostic.goto_prev()<CR>',opts) buf_set_keymap('n','[d','<cmd>lua vim.diagnostic.goto_prev()<CR>',opts)
buf_set_keymap('n',']d','<cmd>lua vim.diagnostic.goto_next()<CR>',opts) buf_set_keymap('n',']d','<cmd>lua vim.diagnostic.goto_next()<CR>',opts)
buf_set_keymap('n','<leader>d','<cmd>lua vim.diagnostic.open_float({border="rounded"})<CR>',opts) buf_set_keymap('n','<leader>d','<cmd>lua vim.diagnostic.open_float({border="rounded"})<CR>',opts)
-- buf_set_keymap('n','<space>f','<cmd>lua vim.lsp.buf.formatting()<CR>',opts) -- buf_set_keymap('n','<space>f','<cmd>lua vim.lsp.buf.formatting()<CR>',opts)
end end
local servers = mason_lsp.get_installed_servers() local servers = mason_lsp.get_installed_servers()
for _, server in ipairs(servers) do for _, server in ipairs(servers) do
local ok, result = pcall(require, "lsp.servers."..server) local ok, result = pcall(require, "lsp.servers."..server)
if ok then if ok then
local lsp_server = lsp[server] local lsp_server = lsp[server]
if lsp_server ~= nil then if lsp_server ~= nil then
local ok, err = pcall(lsp_server.setup, result) local ok, err = pcall(lsp_server.setup, result)
if err ~= nil then if err ~= nil then
vim.pretty_print(err) vim.pretty_print(err)
end end
else else
vim.pretty_print({server = server, result = result}) vim.pretty_print({server = server, result = result})
-- vim.notify("Missing server configuration for " .. server, "error") -- vim.notify("Missing server configuration for " .. server, "error")
end
end end
end
end end

View File

@ -1,52 +1,54 @@
local ok,cmp = pcall(require,"cmp") local ok,cmp = pcall(require,"cmp")
if not ok then if not ok then
vim.notify("Failed to load cmp\n\n") vim.notify("Failed to load cmp\n\n")
return return
end end
cmp.setup { cmp.setup {
mapping = { mapping = {
["<Tab>"] = cmp.mapping.select_next_item(), ["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(), ["<C-N>"] = cmp.mapping.select_next_item(),
["<C-Space>"] = cmp.mapping.complete(), ["<S-Tab>"] = cmp.mapping.select_prev_item(),
["<CR>"] = cmp.mapping.confirm({select = false}), ["<C-P>"] = cmp.mapping.select_prev_item(),
}, ["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({select = false}),
},
completion = { completion = {
autocomplete = true, autocomplete = true,
completeopt = "menu,menuone,noinsert", completeopt = "menu,menuone,noinsert",
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
require('luasnip').lsp_expand(args.body) require('luasnip').lsp_expand(args.body)
end, end,
}, },
window = { window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered() documentation = cmp.config.window.bordered()
}, },
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item) format = function(entry, vim_item)
local kind = require("lspkind").cmp_format({mode = "symbol_text", maxwidth = 50})(entry, vim_item) local kind = require("lspkind").cmp_format({mode = "symbol_text", maxwidth = 50})(entry, vim_item)
local strings = vim.split(kind.kind, "%s",{trimempty = true}) local strings = vim.split(kind.kind, "%s",{trimempty = true})
kind.kind = " " .. strings[1] .. " " kind.kind = " " .. strings[1] .. " "
kind.menu = " (" .. strings[2] .. ")" kind.menu = " (" .. strings[2] .. ")"
return kind return kind
end end
}, },
sources = {
{name = "nvim_lsp"},
{name = "luasnip"},
{name = "emoji"},
{name = "calc"},
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "emoji" },
{ name = "calc" },
},
} }

View File

@ -4,9 +4,9 @@ After=network-online.target
[Service] [Service]
Type=simple Type=simple
EnvironmentFile=/home/q/.config/telegram-bot-api/config.env EnvironmentFile=$HOME/.config/telegram-bot-api/config.env
WorkingDirectory=~ WorkingDirectory=~
ExecStart=/home/q/bin/telegram-bot-api --api-id=${api_id} --api-hash=${api_hash} --local --http-stat-ip-address=${ip} --http-port=${port} --dir=/home/q/.config/telegram-bot-api/ ExecStart=telegram-bot-api --api-id=${api_id} --api-hash=${api_hash} --local --http-stat-ip-address=${ip} --http-port=${port} --dir=$HOME/.config/telegram-bot-api/
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target