From fef41dd0d9d96450d12f18c4601eeb8bfb417a90 Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Thu, 27 Jul 2023 12:50:35 +0200 Subject: [PATCH] update --- i3config | 11 ++++++----- init.lua | 47 ++++++++++++++++++++++++++++++----------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/i3config b/i3config index 437f0e9..a621172 100644 --- a/i3config +++ b/i3config @@ -192,10 +192,10 @@ set $darkgray #1d2021 # green gruvbox # class border|backgr|text|indicator|child_border -client.focused $aqau $aqua $darkgray $purple $aqua -client.focused_inactive $darkgray $darkgray $yellow $purple $darkgray -client.unfocused $red $darkgray $yellow $purple $darkgray -client.urgent $red $red $white $red $red +client.focused $aqua $aqua $aqua $aqua $aqua +client.focused_inactive $darkgray $darkgray $darkgray $darkgray $darkgray +client.unfocused $darkgray $darkgray $darkgray $darkgray $darkgray +client.urgent $red $red $red $red $red bar { i3bar_command i3bar --transparency @@ -224,10 +224,11 @@ exec_always --no-startup-id xset dpms 180 360 720 # bindsym $mod+d exec "dmenu_run -l 10 -nf '#F8F8F2' -nb '#282A36' -sb '#6272A4' -sf '#F8F8F2' -fn 'FiraCode Nerd Font-20' -p 'run:'" -exec feh --bg-fill ~/Pictures/wallpaper.jpg +exec_always feh --bg-fill ~/Pictures/wallpaper.jpg for_window [instance="Godot_Engine"] floating enable for_window [title="Desktop @ QRect(0,0 3840x1200) — Plasma"] kill, floating enable, border none for_window [class="plasmashell"] floating enable +for_window [title="Bevy App"] floating enable for_window [class="Pavucontrol"] floating enable for_window [class="Plasma"] floating enable, border none for_window [title="plasma-desktop"] floating enable, border none diff --git a/init.lua b/init.lua index 80d056f..cb93809 100644 --- a/init.lua +++ b/init.lua @@ -12,7 +12,7 @@ end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - { "NeogitOrg/neogit", dependencies = "nvim-lua/plenary.nvim" }, + { "NeogitOrg/neogit", dependencies = "nvim-lua/plenary.nvim" }, "lewis6991/fileline.nvim", "mfussenegger/nvim-dap", { @@ -93,11 +93,6 @@ require("lazy").setup({ "edluffy/hologram.nvim", "xiyaowong/transparent.nvim", "ellisonleao/gruvbox.nvim", - { - "akinsho/toggleterm.nvim", - version = "*", - opts = { winbar = { enabled = true }, shade_terminals = false, start_in_insert = true }, - }, { "williamboman/mason.nvim", build = ":MasonUpdate", -- :MasonUpdate updates registry contents @@ -117,7 +112,7 @@ require("lazy").setup({ -- Terminal tabs local conditions = require("heirline.conditions") local utils = require("heirline.utils") -heirline = require("heirline") +local heirline = require("heirline") local colors = { bright_bg = utils.get_highlight("Folded").bg, bright_fg = utils.get_highlight("Folded").fg, @@ -162,7 +157,7 @@ local TablineFileNameBlock = { end end, on_click = { - callback = function(_, minwid, _, button) + callback = function(_, minwid, _, _) vim.api.nvim_win_set_buf(0, minwid) end, minwid = function(self) @@ -196,12 +191,12 @@ local TerminalLine = { local BufferLine = { condition = function() return not conditions.buffer_matches({ - buftype = { "terminal" }, + buftype = { "terminal", "nofile" }, }) end, utils.make_buflist(TablineBufferBlock), } -require("heirline").setup({ winbar = { TerminalLine, BufferLine } }) +require("heirline").setup({ winbar = { BufferLine, TerminalLine } }) require("overseer").setup() @@ -245,8 +240,8 @@ local function on_attach(client, buffer) callback = function() vim.lsp.buf.format({ async = false, - filter = function(client) - return client.name ~= "tsserver" + filter = function(cl) + return cl.name ~= "tsserver" end, }) end, @@ -362,9 +357,9 @@ vim.api.nvim_create_autocmd("BufEnter", { callback = function() local layout = vim.api.nvim_call_function("winlayout", {}) if - layout[1] == "leaf" - and vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), "filetype") == "NvimTree" - and layout[3] == nil + layout[1] == "leaf" + and vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), "filetype") == "NvimTree" + and layout[3] == nil then vim.cmd("confirm quit") end @@ -410,7 +405,7 @@ local telescope_builtin = require("telescope.builtin") wk.register({ c = { - name = "Edit", + name = "Config", e = { "e ~/src/dotfiles/init.lua", "Edit config" }, u = { function() @@ -456,6 +451,7 @@ wk.register({ }, }, { prefix = "" }) +vim.keymap.set("n", "", "bnext", {}) vim.keymap.set("n", "", "BufferLinePick", {}) vim.keymap.set("n", "", telescope_builtin.find_files, {}) vim.keymap.set("t", "", "", {}) @@ -463,7 +459,7 @@ vim.keymap.set("n", "", function() if vim.bo.buftype ~= "nofile" and vim.bo.buftype ~= "terminal" then require("bufdelete").bufdelete(0, false) end -end, keymap_opts) +end, {}) -- LSP Config require("lspconfig").tsserver.setup({}) @@ -475,6 +471,16 @@ require("lspconfig").ruby_ls.setup({ cmd = { "bundle", "exec", "ruby-lsp" }, on_attach = on_attach, }) +require("lspconfig").lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + }, + }, +}) require("lspconfig").solargraph.setup({ cmd = { "bundle", "exec", "solargraph", "stdio" }, on_attach = on_attach, @@ -524,3 +530,10 @@ require("nvim-treesitter.configs").setup({ -- Tests vim.g["test#strategy"] = "neovim" + +vim.api.nvim_create_autocmd("BufWritePost", { + pattern = vim.fn.expand("~") .. "/notes/*", + callback = function() + vim.fn.jobstart('git add . && git -C ~/notes commit -am "update" && git -C ~/notes push') + end, +})