From 69383c3a1dce91bda854b07ecd04e2449e236d60 Mon Sep 17 00:00:00 2001 From: ZaneFerns360 Date: Sat, 27 Apr 2024 23:28:43 +0530 Subject: [PATCH] Getting Started --- init.lua | 48 +++++++++++++++++++----------- lua/custom/plugins/keybindings.lua | 5 ++++ lua/custom/plugins/navigation.lua | 47 +++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 lua/custom/plugins/keybindings.lua create mode 100644 lua/custom/plugins/navigation.lua diff --git a/init.lua b/init.lua index 036eefb8..23cecf88 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ 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 +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -166,7 +166,7 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D] vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - +vim.api.nvim_set_keymap('n', 'n', ':Neotree toggle', { noremap = true, silent = true }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. @@ -325,7 +325,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font, lazy = false }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -577,6 +577,19 @@ require('lazy').setup({ -- But for many setups, the LSP (`tsserver`) will work just fine -- tsserver = {}, -- + cssls = { + settings = { + css = { validate = true, lint = { + unknownAtRules = 'ignore', + } }, + scss = { validate = true, lint = { + unknownAtRules = 'ignore', + } }, + less = { validate = true, lint = { + unknownAtRules = 'ignore', + } }, + }, + }, lua_ls = { -- cmd = {...}, @@ -682,12 +695,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, }, 'saadparwaiz1/cmp_luasnip', @@ -733,9 +746,9 @@ require('lazy').setup({ -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -780,6 +793,7 @@ require('lazy').setup({ -- 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. + lazy = false, init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load @@ -874,18 +888,18 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/keybindings.lua b/lua/custom/plugins/keybindings.lua new file mode 100644 index 00000000..64ee53d5 --- /dev/null +++ b/lua/custom/plugins/keybindings.lua @@ -0,0 +1,5 @@ +local keybinds = { + vim.api.nvim_set_keymap('n', ';', ':', { noremap = true }), +} + +return keybinds diff --git a/lua/custom/plugins/navigation.lua b/lua/custom/plugins/navigation.lua new file mode 100644 index 00000000..74a3440e --- /dev/null +++ b/lua/custom/plugins/navigation.lua @@ -0,0 +1,47 @@ +local navigation = { + + 'stevearc/dressing.nvim', + { + 'max397574/better-escape.nvim', + event = 'InsertEnter', + config = function() + require('better_escape').setup() + end, + }, + { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, + }, + { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, + }, +} + +return navigation