From 74b6f3070226821ab949cad18fd65247141bb3ac Mon Sep 17 00:00:00 2001 From: pradeep-mokara Date: Thu, 28 Nov 2024 22:42:00 +0530 Subject: [PATCH] [add] kitty and nvim config --- .config/kitty/current-theme.conf | 80 +++++++++++++++++++ .config/kitty/kitty.conf | 44 ++++++++++ .config/kitty/kitty.conf.bak | 44 ++++++++++ .config/nvim/.stylua.toml | 6 ++ .config/nvim/LICENSE | 24 ++++++ .config/nvim/README.md | 9 +++ .config/nvim/init.lua | 37 +++++++++ .config/nvim/lazy-lock.json | 31 ++++++++ .config/nvim/lua/chadrc.lua | 17 ++++ .config/nvim/lua/configs/conform.lua | 15 ++++ .config/nvim/lua/configs/lazy.lua | 47 +++++++++++ .config/nvim/lua/configs/lspconfig.lua | 24 ++++++ .config/nvim/lua/mappings.lua | 10 +++ .config/nvim/lua/options.lua | 6 ++ .config/nvim/lua/plugins/gopher.lua | 9 +++ .config/nvim/lua/plugins/init.lua | 106 +++++++++++++++++++++++++ .config/nvim/lua/plugins/timerly.lua | 6 ++ 17 files changed, 515 insertions(+) create mode 100644 .config/kitty/current-theme.conf create mode 100644 .config/kitty/kitty.conf create mode 100644 .config/kitty/kitty.conf.bak create mode 100644 .config/nvim/.stylua.toml create mode 100644 .config/nvim/LICENSE create mode 100644 .config/nvim/README.md create mode 100644 .config/nvim/init.lua create mode 100644 .config/nvim/lazy-lock.json create mode 100644 .config/nvim/lua/chadrc.lua create mode 100644 .config/nvim/lua/configs/conform.lua create mode 100644 .config/nvim/lua/configs/lazy.lua create mode 100644 .config/nvim/lua/configs/lspconfig.lua create mode 100644 .config/nvim/lua/mappings.lua create mode 100644 .config/nvim/lua/options.lua create mode 100644 .config/nvim/lua/plugins/gopher.lua create mode 100644 .config/nvim/lua/plugins/init.lua create mode 100644 .config/nvim/lua/plugins/timerly.lua diff --git a/.config/kitty/current-theme.conf b/.config/kitty/current-theme.conf new file mode 100644 index 0000000..2533db7 --- /dev/null +++ b/.config/kitty/current-theme.conf @@ -0,0 +1,80 @@ +# vim:ft=kitty + +## name: Catppuccin-Mocha +## author: Pocco81 (https://github.com/Pocco81) +## license: MIT +## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf +## blurb: Soothing pastel theme for the high-spirited! + + + +# The basic colors +foreground #CDD6F4 +background #1E1E2E +selection_foreground #1E1E2E +selection_background #F5E0DC + +# Cursor colors +cursor #F5E0DC +cursor_text_color #1E1E2E + +# URL underline color when hovering with mouse +url_color #F5E0DC + +# Kitty window border colors +active_border_color #B4BEFE +inactive_border_color #6C7086 +bell_border_color #F9E2AF + +# OS Window titlebar colors +wayland_titlebar_color system +macos_titlebar_color system + +# Tab bar colors +active_tab_foreground #11111B +active_tab_background #CBA6F7 +inactive_tab_foreground #CDD6F4 +inactive_tab_background #181825 +tab_bar_background #11111B + +# Colors for marks (marked text in the terminal) +mark1_foreground #1E1E2E +mark1_background #B4BEFE +mark2_foreground #1E1E2E +mark2_background #CBA6F7 +mark3_foreground #1E1E2E +mark3_background #74C7EC + +# The 16 terminal colors + +# black +color0 #45475A +color8 #585B70 + +# red +color1 #F38BA8 +color9 #F38BA8 + +# green +color2 #A6E3A1 +color10 #A6E3A1 + +# yellow +color3 #F9E2AF +color11 #F9E2AF + +# blue +color4 #89B4FA +color12 #89B4FA + +# magenta +color5 #F5C2E7 +color13 #F5C2E7 + +# cyan +color6 #94E2D5 +color14 #94E2D5 + +# white +color7 #BAC2DE +color15 #A6ADC8 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..2afee34 --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,44 @@ +:q# Tab bar +tab_bar_style fade +tab_fade 1 +# active_tab_foreground #3d59a1 +# active_tab_background #16161e +active_tab_font_style bold +# inactive_tab_foreground #787c99 +# inactive_tab_background #16161e +inactive_tab_font_style bold +# tab_bar_background #101014 + +# Title bar +# macos_titlebar_color #16161e + +# Storm +# background #24283b +# cursor_text_color #24283b +# active_tab_background #1f2335 +# inactive_tab_background #1f2335 +# macos_titlebar_color #1f2335 + +font_family CaskaydiaCove Nerd Font Mono Regular +bold_font CaskaydiaCove Nerd Font Mono Regular +# font_family Mononoki Nerd Font Regular +# bold_font Mononoki Nerd Font Bold +# italic_font BlexMono Nerd Font Mono Italic +# bold_italic_font BlexMono Nerd Font Mono Bold Italic + +font_size 22.0 +disable_ligatures never +shell_integration no-cursor +window_padding_width 2 +hide_window_decorations titlebar-only +background_opacity 1.0 +macos_option_as_alt yes +cursor_trail 5 +map ctrl+f launch --type=overlay --stdin-source=@screen_scrollback /opt/homebrew/bin/fzf --no-sort --no-mouse --exact -i + + + +# BEGIN_KITTY_THEME +# Catppuccin-Mocha +include current-theme.conf +# END_KITTY_THEME diff --git a/.config/kitty/kitty.conf.bak b/.config/kitty/kitty.conf.bak new file mode 100644 index 0000000..9fe3b1f --- /dev/null +++ b/.config/kitty/kitty.conf.bak @@ -0,0 +1,44 @@ +:q# Tab bar +tab_bar_style fade +tab_fade 1 +# active_tab_foreground #3d59a1 +# active_tab_background #16161e +active_tab_font_style bold +# inactive_tab_foreground #787c99 +# inactive_tab_background #16161e +inactive_tab_font_style bold +# tab_bar_background #101014 + +# Title bar +# macos_titlebar_color #16161e + +# Storm +# background #24283b +# cursor_text_color #24283b +# active_tab_background #1f2335 +# inactive_tab_background #1f2335 +# macos_titlebar_color #1f2335 + +font_family CaskaydiaCove Nerd Font Mono Regular +bold_font CaskaydiaCove Nerd Font Mono Regular +# font_family Mononoki Nerd Font Regular +# bold_font Mononoki Nerd Font Bold +# italic_font BlexMono Nerd Font Mono Italic +# bold_italic_font BlexMono Nerd Font Mono Bold Italic + +font_size 22.0 +disable_ligatures never +shell_integration no-cursor +window_padding_width 2 +hide_window_decorations titlebar-only +background_opacity 1.0 +macos_option_as_alt yes +cursor_trail 5 +map ctrl+f launch --type=overlay --stdin-source=@screen_scrollback /opt/homebrew/bin/fzf --no-sort --no-mouse --exact -i + + + +# BEGIN_KITTY_THEME +# Catppuccin-Latte +include current-theme.conf +# END_KITTY_THEME diff --git a/.config/nvim/.stylua.toml b/.config/nvim/.stylua.toml new file mode 100644 index 0000000..ecb6dca --- /dev/null +++ b/.config/nvim/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/.config/nvim/LICENSE b/.config/nvim/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/.config/nvim/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/.config/nvim/README.md b/.config/nvim/README.md new file mode 100644 index 0000000..dc0deaa --- /dev/null +++ b/.config/nvim/README.md @@ -0,0 +1,9 @@ +**This repo is supposed to used as config by NvChad users!** + +- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo. +- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"` +- So you can delete the .git from this repo ( when you clone it locally ) or fork it :) + +# Credits + +1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier! diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..0fda20c --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,37 @@ +vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/" +vim.g.mapleader = " " + +-- bootstrap lazy and all plugins +local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" + +if not vim.uv.fs_stat(lazypath) then + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } +end + +vim.opt.rtp:prepend(lazypath) + +local lazy_config = require "configs.lazy" + +-- load plugins +require("lazy").setup({ + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + }, + + { import = "plugins" }, +}, lazy_config) + +-- load theme +dofile(vim.g.base46_cache .. "defaults") +dofile(vim.g.base46_cache .. "statusline") + +require "options" +require "nvchad.autocmds" + +vim.schedule(function() + require "mappings" +end) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..49fe06e --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,31 @@ +{ + "LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, + "NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" }, + "base46": { "branch": "v2.5", "commit": "40943fc668bf8f1caa4cc45f71c784cf0d3cc34f" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "gopher.nvim": { "branch": "main", "commit": "f55c15ada8e02398000c04a96ef44d986cd01051" }, + "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, + "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" }, + "minty": { "branch": "main", "commit": "b454ca0229f8e22a631fd3c014ec99973fb8cad4" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" }, + "nvim-lspconfig": { "branch": "master", "commit": "dafd61d6533bd90ecf6e2a3a972298fdddc74d82" }, + "nvim-tree.lua": { "branch": "master", "commit": "ca7c4c33cac2ad66ec69d45e465379716ef0cc97" }, + "nvim-treesitter": { "branch": "master", "commit": "d14bc4bd15a7b9b5a9e7977c6a28f2cab6c4ad4a" }, + "nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, + "timerly": { "branch": "main", "commit": "6a25eec63ca42491de4706587b84182e85e6e7f4" }, + "ui": { "branch": "v3.0", "commit": "7905539f1e10f460811dc0db800355611f8a527a" }, + "volt": { "branch": "main", "commit": "8d35e03c70490190149a77c59155618ef4370721" }, + "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" } +} diff --git a/.config/nvim/lua/chadrc.lua b/.config/nvim/lua/chadrc.lua new file mode 100644 index 0000000..3ecfa7e --- /dev/null +++ b/.config/nvim/lua/chadrc.lua @@ -0,0 +1,17 @@ +-- This file needs to have same structure as nvconfig.lua +-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua +-- Please read that file to know all available options :( + +---@type ChadrcConfig +local M = {} + +M.base46 = { + theme = "catppuccin", + + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, +} + +return M diff --git a/.config/nvim/lua/configs/conform.lua b/.config/nvim/lua/configs/conform.lua new file mode 100644 index 0000000..35ba6cf --- /dev/null +++ b/.config/nvim/lua/configs/conform.lua @@ -0,0 +1,15 @@ +local options = { + formatters_by_ft = { + lua = { "stylua" }, + -- css = { "prettier" }, + -- html = { "prettier" }, + }, + + -- format_on_save = { + -- -- These options will be passed to conform.format() + -- timeout_ms = 500, + -- lsp_fallback = true, + -- }, +} + +return options diff --git a/.config/nvim/lua/configs/lazy.lua b/.config/nvim/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/.config/nvim/lua/configs/lazy.lua @@ -0,0 +1,47 @@ +return { + defaults = { lazy = true }, + install = { colorscheme = { "nvchad" } }, + + ui = { + icons = { + ft = "", + lazy = "󰂠 ", + loaded = "", + not_loaded = "", + }, + }, + + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "tohtml", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", + }, + }, + }, +} diff --git a/.config/nvim/lua/configs/lspconfig.lua b/.config/nvim/lua/configs/lspconfig.lua new file mode 100644 index 0000000..549c646 --- /dev/null +++ b/.config/nvim/lua/configs/lspconfig.lua @@ -0,0 +1,24 @@ +-- load defaults i.e lua_lsp +require("nvchad.configs.lspconfig").defaults() + +local lspconfig = require "lspconfig" + +-- EXAMPLE +local servers = { "html", "cssls" , "pyright"} +local nvlsp = require "nvchad.configs.lspconfig" + +-- lsps with default config +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = nvlsp.on_attach, + on_init = nvlsp.on_init, + capabilities = nvlsp.capabilities, + } +end + +-- configuring single server, example: typescript +-- lspconfig.ts_ls.setup { +-- on_attach = nvlsp.on_attach, +-- on_init = nvlsp.on_init, +-- capabilities = nvlsp.capabilities, +-- } diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua new file mode 100644 index 0000000..783b78f --- /dev/null +++ b/.config/nvim/lua/mappings.lua @@ -0,0 +1,10 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") + +-- map({ "n", "i", "v" }, "", " w ") diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua new file mode 100644 index 0000000..738f20b --- /dev/null +++ b/.config/nvim/lua/options.lua @@ -0,0 +1,6 @@ +require "nvchad.options" + +-- add yours here! + +-- local o = vim.o +-- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/.config/nvim/lua/plugins/gopher.lua b/.config/nvim/lua/plugins/gopher.lua new file mode 100644 index 0000000..643d156 --- /dev/null +++ b/.config/nvim/lua/plugins/gopher.lua @@ -0,0 +1,9 @@ +return { + "olexsmir/gopher.nvim", + enabled = true, + ft = "go", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, +} diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..fe83a2a --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,106 @@ +return { + { + "stevearc/conform.nvim", + -- event = 'BufWritePre', -- uncomment for format on save + opts = require "configs.conform", + }, + + -- These are some examples, uncomment them if you want to see them work! + { + "neovim/nvim-lspconfig", + config = function() + require "configs.lspconfig" + end, + }, + + -- { + -- "williamboman/mason.nvim", + -- opts = { + -- ensure_installed = { + -- "gopls", + -- }, + -- }, + -- }, + -- + + require('gitsigns').setup { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + auto_attach = true, + attach_to_untracked = false, + current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 10, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + + on_attach = function(bufnr) + local gitsigns = require('gitsigns') + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal({ ']c', bang = true }) + else + gitsigns.nav_hunk('next') + end + end) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal({ '[c', bang = true }) + else + gitsigns.nav_hunk('prev') + end + end) + + map('n', ']p', gitsigns.preview_hunk) + + end +} +} diff --git a/.config/nvim/lua/plugins/timerly.lua b/.config/nvim/lua/plugins/timerly.lua new file mode 100644 index 0000000..de28c07 --- /dev/null +++ b/.config/nvim/lua/plugins/timerly.lua @@ -0,0 +1,6 @@ +return { + { + "nvzone/volt", + { "nvzone/timerly", cmd = "TimerlyToggle" } + } +}