From 3056d26281e9f2d66eca5014346ff1bb4158d009 Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Sun, 1 Oct 2023 16:38:03 +0530 Subject: [PATCH] changes lmao --- .winitrc | 3 +- nvim/init.lua | 173 +++++++++++---------- nvim/lua/user/lsp/handlers.lua | 2 +- nvim/lua/user/lsp/mason.lua | 34 ++-- nvim/lua/user/lsp/settings/lua_ls.lsp | 9 ++ nvim/lua/user/lsp/settings/sumneko_lua.lsp | 15 -- nvim/plugin/packer_compiled.lua | 29 +++- sway/config | 10 +- 8 files changed, 147 insertions(+), 128 deletions(-) create mode 100644 nvim/lua/user/lsp/settings/lua_ls.lsp delete mode 100644 nvim/lua/user/lsp/settings/sumneko_lua.lsp diff --git a/.winitrc b/.winitrc index a2839f6..f7e65d1 100755 --- a/.winitrc +++ b/.winitrc @@ -28,6 +28,7 @@ export XDG_SESSION_DESKTOP=Sway export WLR_NO_HARDWARE_CURSORS=1 # fix for slow loads on igpu-only mode +# export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json:/usr/share/glvnd/egl_vendor.d/10_nvidia.json # gnome keyring @@ -38,7 +39,7 @@ export SSH_AUTH_SOCK #status=$(sudo cat /sys/class/drm/card1-HDMI-A-2/status) #if [ "$status" = "connected" ]; then # export WLR_RENDERER=vulkan -# export WLR_DRM_DEVICES=/dev/dri/card1 +#export WLR_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1 #fi sway --unsupported-gpu diff --git a/nvim/init.lua b/nvim/init.lua index a3eaaec..eb62dac 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,112 +1,114 @@ -local use = require('packer').use -require('packer').startup(function() - -- required - use 'wbthomason/packer.nvim' - use 'nvim-lua/plenary.nvim' - - -- common/visual plugins - use 'powerline/powerline-fonts' - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true } - } - use 'kdheepak/tabline.nvim' - use 'junegunn/goyo.vim' - use 'gpanders/editorconfig.nvim' - use { - 'nvim-telescope/telescope-fzf-native.nvim', - run = 'make' - } - use { - 'nvim-telescope/telescope.nvim', - tag = '0.1.0', - } - use { - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'RubixDev/mason-update-all', - 'neovim/nvim-lspconfig' - } - use { - 'catppuccin/nvim', - as = 'catpuccin' - } - - use 'nvim-treesitter/nvim-treesitter' - - use 'jose-elias-alvarez/null-ls.nvim' - - use 'RRethy/vim-illuminate' - - -- cmp - use "hrsh7th/nvim-cmp" - use "hrsh7th/cmp-buffer" - use "hrsh7th/cmp-path" - use "hrsh7th/cmp-nvim-lsp" - use 'L3MON4D3/LuaSnip' - use 'saadparwaiz1/cmp_luasnip' - use "hrsh7th/cmp-nvim-lua" - - -- indent lines - use "lukas-reineke/indent-blankline.nvim" - +local use = require("packer").use +require("packer").startup(function() + -- required + use("wbthomason/packer.nvim") + use("nvim-lua/plenary.nvim") + + -- common/visual plugins + use("powerline/powerline-fonts") + use({ + "nvim-lualine/lualine.nvim", + requires = { "kyazdani42/nvim-web-devicons", opt = true }, + }) + use("kdheepak/tabline.nvim") + use("junegunn/goyo.vim") + use("gpanders/editorconfig.nvim") + use({ + "nvim-telescope/telescope-fzf-native.nvim", + run = "make", + }) + use({ + "nvim-telescope/telescope.nvim", + tag = "0.1.0", + }) + use({ + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "RubixDev/mason-update-all", + "neovim/nvim-lspconfig", + }) + use({ + "catppuccin/nvim", + as = "catpuccin", + }) + + use("nvim-treesitter/nvim-treesitter") + + use("jose-elias-alvarez/null-ls.nvim") + + use("RRethy/vim-illuminate") + + -- cmp + use("hrsh7th/nvim-cmp") + use("hrsh7th/cmp-buffer") + use("hrsh7th/cmp-path") + use("hrsh7th/cmp-nvim-lsp") + use("L3MON4D3/LuaSnip") + use("saadparwaiz1/cmp_luasnip") + use("hrsh7th/cmp-nvim-lua") + + -- indent lines + use("lukas-reineke/indent-blankline.nvim") end) require("user.basics") -vim.cmd.colorscheme 'catppuccin-macchiato' -vim.opt.guicursor = 'n:block-Number,i:ver30' +vim.cmd.colorscheme("catppuccin-macchiato") +vim.opt.guicursor = "n:block-Number,i:ver30" local function map(mode, shortcut, command) - vim.keymap.set(mode, shortcut, command, { noremap = true }) + vim.keymap.set(mode, shortcut, command, { noremap = true }) end local function nmap(shortcut, command) - map('n', shortcut, command) + map("n", shortcut, command) end -local use builtin = require("telescope.builtin") +local use +builtin = require("telescope.builtin") nmap("", builtin.find_files) -require("lualine").setup{ - options = { - theme = 'auto' - } -} +require("lualine").setup({ + options = { + theme = "auto", + }, +}) -require("tabline").setup{ - vim.cmd([[ +require("tabline").setup({ + vim.cmd([[ set guioptions-=e set sessionoptions+=tabpages,globals - ]]) -} + ]]), +}) local status_ok, configs = pcall(require, "nvim-treesitter.configs") if not status_ok then - return + return end configs.setup({ - ensure_installed = "all", - ignore_install = { "" }, - sync_install = false, - highlight = { - enable = true, - disable = { "" }, - additional_vim_regex_highlighting = true, - }, - indent = { enable = true, disable = { "yaml" } } + ensure_installed = "all", + ignore_install = { "" }, + sync_install = false, + highlight = { + enable = true, + disable = { "" }, + additional_vim_regex_highlighting = true, + }, + indent = { enable = true, disable = { "yaml" } }, }) -- indent blankline plugin vim.opt.list = true -vim.opt.listchars:append "space:⋅" -vim.opt.listchars:append "eol:↴" -require("indent_blankline").setup { - show_end_of_line = true, - show_current_context = true, - show_current_context_start = true, -} +vim.opt.listchars:append("space:⋅") +vim.opt.listchars:append("eol:↴") +---require("ibl").setup({ +--- show_end_of_line = true, +--- show_current_context = true, +--- show_current_context_start = true, +---}) + +require("ibl").setup() nmap("", "TablineTabNew") nmap("", "TablineBufferNext") @@ -116,6 +118,5 @@ nmap("", "bd!") nmap("", "ls") nmap("", "Goyo") -require('user.cmp') -require('user.lsp') - +require("user.cmp") +require("user.lsp") diff --git a/nvim/lua/user/lsp/handlers.lua b/nvim/lua/user/lsp/handlers.lua index 3edef49..feccca2 100644 --- a/nvim/lua/user/lsp/handlers.lua +++ b/nvim/lua/user/lsp/handlers.lua @@ -60,7 +60,7 @@ local function lsp_keymaps(bufnr) keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) - keymap(bufnr, "n", "lf", "lua vim.lsp.buf.format", opts) + keymap(bufnr, "n", "lf", "lua vim.lsp.buf.format()", opts) keymap(bufnr, "n", "li", "LspInfo", opts) keymap(bufnr, "n", "lI", "LspInstallInfo", opts) keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) diff --git a/nvim/lua/user/lsp/mason.lua b/nvim/lua/user/lsp/mason.lua index 4f474d6..1eb4d60 100644 --- a/nvim/lua/user/lsp/mason.lua +++ b/nvim/lua/user/lsp/mason.lua @@ -1,25 +1,25 @@ local servers = { - 'lua_ls', - 'pyright', - 'tsserver', - 'terraformls', + "lua_ls", + "pyright", + "tsserver", + "terraformls", } -require('mason').setup() -require('mason-lspconfig').setup({ +require("mason").setup() +require("mason-lspconfig").setup({ ensure_installed = servers, automatic_installation = true, }) -require('mason-update-all').setup() +require("mason-update-all").setup() -vim.api.nvim_create_autocmd('User', { - pattern = 'MasonUpdateAllComplete', - callback = function() - print('mason-update-all has finished') - end, +vim.api.nvim_create_autocmd("User", { + pattern = "MasonUpdateAllComplete", + callback = function() + print("mason-update-all has finished") + end, }) -local lsp_status_ok, lspconfig = pcall(require, 'lspconfig') +local lsp_status_ok, lspconfig = pcall(require, "lspconfig") if not lsp_status_ok then return end @@ -28,13 +28,13 @@ local opts = {} for _, server in pairs(servers) do opts = { - on_attach = require('user.lsp.handlers').on_attach, - capabilities = require('user.lsp.handlers').capabilities, + on_attach = require("user.lsp.handlers").on_attach, + capabilities = require("user.lsp.handlers").capabilities, } - server = vim.split(server, '@')[1] + server = vim.split(server, "@")[1] - local require_ok, conf_opts = pcall(require, 'user.lsp.settings.' .. server) + local require_ok, conf_opts = pcall(require, "user.lsp.settings." .. server) if require_ok then opts = vim.tbl_deep_extend("force", conf_opts, opts) end diff --git a/nvim/lua/user/lsp/settings/lua_ls.lsp b/nvim/lua/user/lsp/settings/lua_ls.lsp new file mode 100644 index 0000000..54f3aef --- /dev/null +++ b/nvim/lua/user/lsp/settings/lua_ls.lsp @@ -0,0 +1,9 @@ +return { + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + }, + }, +} diff --git a/nvim/lua/user/lsp/settings/sumneko_lua.lsp b/nvim/lua/user/lsp/settings/sumneko_lua.lsp deleted file mode 100644 index 6d27e62..0000000 --- a/nvim/lua/user/lsp/settings/sumneko_lua.lsp +++ /dev/null @@ -1,15 +0,0 @@ -return { - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/nvim/plugin/packer_compiled.lua b/nvim/plugin/packer_compiled.lua index c880406..196af36 100644 --- a/nvim/plugin/packer_compiled.lua +++ b/nvim/plugin/packer_compiled.lua @@ -49,8 +49,8 @@ local function save_profiles(threshold) end time([[Luarocks path setup]], true) -local package_path_str = "/home/ayush/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/ayush/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/ayush/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/ayush/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/ayush/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +local package_path_str = "/home/ayush/.cache/nvim/packer_hererocks/2.1.1694285958/share/lua/5.1/?.lua;/home/ayush/.cache/nvim/packer_hererocks/2.1.1694285958/share/lua/5.1/?/init.lua;/home/ayush/.cache/nvim/packer_hererocks/2.1.1694285958/lib/luarocks/rocks-5.1/?.lua;/home/ayush/.cache/nvim/packer_hererocks/2.1.1694285958/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/ayush/.cache/nvim/packer_hererocks/2.1.1694285958/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end @@ -74,6 +74,16 @@ end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { + LuaSnip = { + loaded = true, + path = "/home/ayush/.local/share/nvim/site/pack/packer/start/LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip" + }, + catpuccin = { + loaded = true, + path = "/home/ayush/.local/share/nvim/site/pack/packer/start/catpuccin", + url = "https://github.com/catppuccin/nvim" + }, ["cmp-buffer"] = { loaded = true, path = "/home/ayush/.local/share/nvim/site/pack/packer/start/cmp-buffer", @@ -109,6 +119,11 @@ _G.packer_plugins = { path = "/home/ayush/.local/share/nvim/site/pack/packer/start/goyo.vim", url = "https://github.com/junegunn/goyo.vim" }, + ["indent-blankline.nvim"] = { + loaded = true, + path = "/home/ayush/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim", + url = "https://github.com/lukas-reineke/indent-blankline.nvim" + }, ["lualine.nvim"] = { loaded = true, path = "/home/ayush/.local/share/nvim/site/pack/packer/start/lualine.nvim", @@ -119,6 +134,11 @@ _G.packer_plugins = { path = "/home/ayush/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", url = "https://github.com/williamboman/mason-lspconfig.nvim" }, + ["mason-update-all"] = { + loaded = true, + path = "/home/ayush/.local/share/nvim/site/pack/packer/start/mason-update-all", + url = "https://github.com/RubixDev/mason-update-all" + }, ["mason.nvim"] = { loaded = true, path = "/home/ayush/.local/share/nvim/site/pack/packer/start/mason.nvim", @@ -150,11 +170,6 @@ _G.packer_plugins = { path = "/home/ayush/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons", url = "https://github.com/kyazdani42/nvim-web-devicons" }, - ["onedark.vim"] = { - loaded = true, - path = "/home/ayush/.local/share/nvim/site/pack/packer/start/onedark.vim", - url = "https://github.com/joshdick/onedark.vim" - }, ["packer.nvim"] = { loaded = true, path = "/home/ayush/.local/share/nvim/site/pack/packer/start/packer.nvim", diff --git a/sway/config b/sway/config index 2dfae13..6180589 100644 --- a/sway/config +++ b/sway/config @@ -3,15 +3,22 @@ output eDP-1 { #mode 1920x1080@60.004Hz mode 1920x1080@144.003Hz scale 1.0 - adaptive_sync off + adaptive_sync on } output DP-1 { + mode 2560x1440@144.000Hz + scale 1.0 + adaptive_sync on +} + +output HDMI-A-2 { mode 2560x1440@144.000Hz scale 1.0 adaptive_sync off } + # set mouse input type:pointer { accel_profile flat @@ -217,6 +224,7 @@ gaps inner 20 # set smart gaps #smart_gaps on +bindsym $mod+g exec "swaymsg gaps inner current toggle 20" # set desktop bg exec_always swaybg -i ~/.config/sway/wall.jpg -m stretch