From 28b95faec003891531fc44ea437dc5c67d8d5cdd Mon Sep 17 00:00:00 2001 From: Alexander Gruzdkov Date: Fri, 19 Apr 2024 00:51:52 +0600 Subject: [PATCH] initial commit switch to papercolor fix which key [chore] a little cleanup --- .gitignore | 1 + init.lua | 152 +++++++++++++++++++++++++-------------------------- lazyvim.json | 9 +++ 3 files changed, 83 insertions(+), 79 deletions(-) create mode 100644 lazyvim.json diff --git a/.gitignore b/.gitignore index 005b535b..86152ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ nvim spell/ lazy-lock.json +.DS_Store diff --git a/init.lua b/init.lua index 4eae8e7d..9f4711fc 100644 --- a/init.lua +++ b/init.lua @@ -84,26 +84,26 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +vim.o.background = 'light' -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +-- Set to true if you have a Nerd Font installed +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` -- NOTE: You can change these options as you wish! -- For more options, you can see `:help option-list` - -- Make line numbers default vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true - +vim.opt.relativenumber = true +vim.opt.termguicolors = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -127,12 +127,13 @@ vim.opt.undofile = true -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term vim.opt.ignorecase = true vim.opt.smartcase = true - +vim.opt.scrolloff = 8 +vim.opt.colorcolumn = '100' -- Keep signcolumn on by default vim.opt.signcolumn = 'yes' -- Decrease update time -vim.opt.updatetime = 250 +vim.opt.updatetime = 50 -- Decrease mapped sequence wait time vim.opt.timeoutlen = 300 @@ -158,6 +159,8 @@ vim.opt.scrolloff = 10 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` +vim.keymap.set('n', 'x', 'Ex') +vim.keymap.set('n', 'ef', vim.cmd.EslintFixAll) -- Clear highlights on search when pressing in normal mode -- See `:help hlsearch` @@ -266,63 +269,24 @@ require('lazy').setup({ -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- - -- Then, because we use the `opts` key (recommended), the configuration runs - -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - + -- Then, because we use the `config` key, the configuration only runs + -- after the plugin has been loaded: + -- config = function() ... end + -- { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', - event = 'VimEnter', -- Sets the loading event to 'VimEnter' - opts = { - -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.opt.timeoutlen - delay = 0, - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, - }, - - -- Document existing key chains - spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, + event = 'VeryLazy', -- Sets the loading event to 'VimEnter' + keys = { + { 'c', group = '[C]ode' }, + { 'c_', hidden = true }, + { 'd', group = '[D]ocument' }, + { 'd_', hidden = true }, + { 'r', group = '[R]ename' }, + { 'r_', hidden = true }, + { 's', group = '[S]earch' }, + { 's_', hidden = true }, + { 'w', group = '[W]orkspace' }, + { 'w_', hidden = true }, }, }, @@ -413,6 +377,8 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('i', 'jj', '', { silent = true }) + -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. @@ -615,7 +581,35 @@ require('lazy').setup({ -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + local nvim_lsp = require 'lspconfig' local servers = { + svelte = {}, + solargraph = {}, + volar = {}, + tailwindcss = {}, + prettier = {}, + html = {}, + cssls = {}, + ts_ls = { + init_options = { + plugins = { + { + name = '@vue/typescript-plugin', + location = '/Users/notfun/.nvm/versions/node/v22.13.1/lib/node_modules/@vue/typescript-plugin', + languages = { 'javascript', 'typescript', 'vue' }, + }, + }, + }, + filetypes = { + 'javascript', + 'typescriptreact', + 'javascriptreact', + 'typescript', + 'vue', + }, + root_dir = nvim_lsp.util.root_pattern 'package.json', + single_file_support = false, + }, -- clangd = {}, -- gopls = {}, -- pyright = {}, @@ -716,8 +710,13 @@ require('lazy').setup({ -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + -- You can use a sub-list to tell conform to run *until* a formatter + -- is found. + -- javascript = { { "prettierd", "prettier" } }, + vue = { { 'prettierd', 'prettier' } }, + javascript = { { 'prettierd', 'prettier' } }, + typescript = { { 'prettierd', 'prettier' } }, + volar = { { 'prettierd', 'prettier' } }, }, }, }, @@ -837,24 +836,19 @@ require('lazy').setup({ } end, }, - - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. + { + 'zenbones-theme/zenbones.nvim', + name = 'zenbones', + priority = 1000, + lazy = false, + dependencies = 'rktjmp/lush.nvim', init = function() - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - - -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' + vim.cmd.colorscheme 'zenbones' end, }, + { + 'rktjmp/lush.nvim', + }, -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 00000000..f03853fb --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "3314" + }, + "version": 3 +} \ No newline at end of file