From 1b3b91504d5d6fa39de2f051badefff718baecc8 Mon Sep 17 00:00:00 2001 From: Dinesh Salunke Date: Fri, 16 Jun 2023 00:47:49 +0530 Subject: [PATCH] chore: colorschem and basic editor plugins --- init.lua | 4 +++ lazy-lock.json | 9 +++++ lua/dino/autocmds.lua | 0 lua/dino/keymaps.lua | 0 lua/dino/lazy.lua | 14 ++++++++ lua/dino/options.lua | 55 +++++++++++++++++++++++++++++++ lua/plugins/colorscheme.lua | 10 ++++++ lua/plugins/editor.lua | 66 +++++++++++++++++++++++++++++++++++++ lua/plugins/ui.lua | 9 +++++ lua/plugins/util.lua | 6 ++++ stylua.toml | 3 ++ 11 files changed, 176 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/dino/autocmds.lua create mode 100644 lua/dino/keymaps.lua create mode 100644 lua/dino/lazy.lua create mode 100644 lua/dino/options.lua create mode 100644 lua/plugins/colorscheme.lua create mode 100644 lua/plugins/editor.lua create mode 100644 lua/plugins/ui.lua create mode 100644 lua/plugins/util.lua create mode 100644 stylua.toml diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..dd4f3c0 --- /dev/null +++ b/init.lua @@ -0,0 +1,4 @@ +require("dino.options") +require("dino.keymaps") +require("dino.autocmds") +require("dino.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..b6448dd --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,9 @@ +{ + "gitsigns.nvim": { "branch": "main", "commit": "4f8f66da9816ec4c4847653c9ab9bcb9c609508c" }, + "lazy.nvim": { "branch": "main", "commit": "6b2311a46a3808e366bb251270f4cc04afb421ed" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "plenary.nvim": { "branch": "master", "commit": "36aaceb6e93addd20b1b18f94d86aecc552f30c4" }, + "poimandres.nvim": { "branch": "main", "commit": "43ea31d1e19f7603697bb3272b233930d0292383" }, + "telescope.nvim": { "branch": "master", "commit": "c1a2af0af69e80e14e6b226d3957a064cd080805" }, + "which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" } +} \ No newline at end of file diff --git a/lua/dino/autocmds.lua b/lua/dino/autocmds.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/dino/keymaps.lua b/lua/dino/keymaps.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/dino/lazy.lua b/lua/dino/lazy.lua new file mode 100644 index 0000000..38eda2a --- /dev/null +++ b/lua/dino/lazy.lua @@ -0,0 +1,14 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup("plugins") diff --git a/lua/dino/options.lua b/lua/dino/options.lua new file mode 100644 index 0000000..0b5ab6c --- /dev/null +++ b/lua/dino/options.lua @@ -0,0 +1,55 @@ +-- This file is automatically loaded by plugins.config +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +local opt = vim.opt + +opt.autowrite = true -- Enable auto write +opt.clipboard = "unnamedplus" -- Sync with system clipboard +opt.completeopt = "menu,menuone,noselect" +opt.conceallevel = 3 -- Hide * markup for bold and italic +opt.confirm = true -- Confirm to save changes before exiting modified buffer +opt.cursorline = true -- Enable highlighting of the current line +opt.expandtab = true -- Use spaces instead of tabs +opt.formatoptions = "jcroqlnt" -- tcqj +opt.grepformat = "%f:%l:%c:%m" +opt.grepprg = "rg --vimgrep" +opt.ignorecase = true -- Ignore case +opt.inccommand = "nosplit" -- preview incremental substitute +opt.laststatus = 0 +opt.list = true -- Show some invisible characters (tabs... +opt.mouse = "a" -- Enable mouse mode +opt.number = true -- Print line number +opt.pumblend = 10 -- Popup blend +opt.pumheight = 10 -- Maximum number of entries in a popup +opt.relativenumber = true -- Relative line numbers +opt.scrolloff = 4 -- Lines of context +opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } +opt.shiftround = true -- Round indent +opt.shiftwidth = 4 -- Size of an indent +opt.shortmess:append({ W = true, I = true, c = true }) +opt.showmode = false -- Dont show mode since we have a statusline +opt.sidescrolloff = 8 -- Columns of context +opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time +opt.smartcase = true -- Don't ignore case with capitals +opt.smartindent = true -- Insert indents automatically +opt.spelllang = { "en" } +opt.splitbelow = true -- Put new windows below current +opt.splitright = true -- Put new windows right of current +opt.tabstop = 4 -- Number of spaces tabs count for +opt.termguicolors = true -- True color support +opt.timeoutlen = 300 +opt.undofile = true +opt.undolevels = 10000 +opt.updatetime = 200 -- Save swap file and trigger CursorHold +opt.wildmode = "longest:full,full" -- Command-line completion mode +opt.winminwidth = 5 -- Minimum window width +opt.wrap = false -- Disable line wrap + +if vim.fn.has("nvim-0.9.0") == 1 then + opt.splitkeep = "screen" + opt.shortmess:append({ C = true }) +end + +-- Fix markdown indentation settings +vim.g.markdown_recommended_style = 0 diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..4ce3e20 --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,10 @@ +return { + { + "dineshsalunke/poimandres.nvim", + priority = 1000, + opts = {}, + config = function () + vim.cmd.colorscheme "poimandres" + end + } +} diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua new file mode 100644 index 0000000..2638c40 --- /dev/null +++ b/lua/plugins/editor.lua @@ -0,0 +1,66 @@ +return { + { + "nvim-telescope/telescope.nvim", + tag = "0.1.1", + dependecies = { + "nvim-lua/plenary.nvim" + }, + keys = { + { + "sf", + function() + require("telescope.builtin").find_files() + end, + desc = "Search files" + }, + + { + "sg", + function () + require("telescope.builtin").live_grep() + end, + desc = "Live grep" + } + }, + opts = { + defaults = { + prompt_prefix = "", + selection_caret = "", + mappings = { + i = { + [""] = function(...) require("telescope.actions").move_selection_previous(...) end, + [""] = function(...) require("telescope.actions").move_selection_next(...) end, + } + } + } + } + }, + + { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + plugins = { + spelling = true + } + } + }, + + { + "lewis6991/gitsigns.nvim", + event = { + "BufReadPre", + "BufNewFile", + }, + opts = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + } + } + } +} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua new file mode 100644 index 0000000..0dd441b --- /dev/null +++ b/lua/plugins/ui.lua @@ -0,0 +1,9 @@ +return { + { + "nvim-lualine/lualine.nvim", + dependecies = { + "nvim-tree/nvim-web-devicons" + }, + opts = {}, + } +} diff --git a/lua/plugins/util.lua b/lua/plugins/util.lua new file mode 100644 index 0000000..52e508c --- /dev/null +++ b/lua/plugins/util.lua @@ -0,0 +1,6 @@ +return { + { + "nvim-lua/plenary.nvim", + lazy = true + } +} diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..e55efd5 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 4 +column_width = 120