diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua new file mode 100644 index 0000000..98c897d --- /dev/null +++ b/after/plugin/colors.lua @@ -0,0 +1,16 @@ +require('tokyonight').setup({ + style = "night", + styles = { + comments = { italic = false }, + keywords = { italic = false } + } +}) + +function ColorMyPencils(color) + color = color or 'tokyonight' + vim.cmd.colorscheme(color) + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + +ColorMyPencils() diff --git a/after/plugin/fugitive.lua b/after/plugin/fugitive.lua new file mode 100644 index 0000000..73b78b8 --- /dev/null +++ b/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "gs", vim.cmd.Git); diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua new file mode 100644 index 0000000..eed35ed --- /dev/null +++ b/after/plugin/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n", "a", mark.add_file) +vim.keymap.set("n", "", ui.toggle_quick_menu) + +vim.keymap.set("n", "", function() ui.nav_file(1) end) +vim.keymap.set("n", "", function() ui.nav_file(2) end) +vim.keymap.set("n", "", function() ui.nav_file(3) end) +vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua new file mode 100644 index 0000000..6fa5295 --- /dev/null +++ b/after/plugin/lsp.lua @@ -0,0 +1,43 @@ +local lsp = require('lsp-zero') + +lsp.preset('recommended') +lsp.setup_servers({ + 'tsserver', + 'eslint', + 'rust_analyzer', + 'ccls', + 'clangd', + 'java_language_server', + 'lua_ls' +}) + +local cmp = require('cmp') +local cmp_select = {behavior = cmp.SelectBehavior.Select} +local cmp_mappings = lsp.defaults.cmp_mappings({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ select = true}), + [""] = cmp.mapping.complete(), +}) + +lsp.set_preferences({ + sign_icons = { } +}) + +lsp.setup({ + mapping = cmp_mappings +}) + +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr, remap = false} + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.diagnostic.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() end, opts) +end) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua new file mode 100644 index 0000000..4806008 --- /dev/null +++ b/after/plugin/telescope.lua @@ -0,0 +1,6 @@ +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'pf', builtin.find_files, {}) +vim.keymap.set('n', '', builtin.git_files, {}) +vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }); +end) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua new file mode 100644 index 0000000..0766cca --- /dev/null +++ b/after/plugin/treesitter.lua @@ -0,0 +1,21 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "java", "javascript", "typescript", "bash" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} diff --git a/after/plugin/undotree.lua b/after/plugin/undotree.lua new file mode 100644 index 0000000..b6b9276 --- /dev/null +++ b/after/plugin/undotree.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..4bbe9f9 --- /dev/null +++ b/init.lua @@ -0,0 +1 @@ +require("anth64") diff --git a/lua/anth64/init.lua b/lua/anth64/init.lua new file mode 100644 index 0000000..6d26b81 --- /dev/null +++ b/lua/anth64/init.lua @@ -0,0 +1,2 @@ +require("anth64.set") +require("anth64.remap") diff --git a/lua/anth64/packer.lua b/lua/anth64/packer.lua new file mode 100644 index 0000000..c05adb7 --- /dev/null +++ b/lua/anth64/packer.lua @@ -0,0 +1,41 @@ +-- This file can be loaded by calling `lua require('plugins')` from your init.vim + +-- Only required if you have packer configured as `opt` +vim.cmd [[packadd packer.nvim]] + +return require('packer').startup(function(use) + -- Packer can manage itself + use 'wbthomason/packer.nvim' + + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.4', + -- or , branch = '0.1.x', + requires = { {'nvim-lua/plenary.nvim'} } + } + + use('nvim-treesitter/nvim-treesitter', {run = ':TsUpdate'}) + use('nvim-treesitter/playground') + use('theprimeagen/harpoon') + use('mbbill/undotree') + use('tpope/vim-fugitive') + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + requires = { + -- LSP Support + {'neovim/nvim-lspconfig'}, + -- Autocompletion + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'L3MON4D3/LuaSnip'}, + } + } + -- Color schemes. + use({ + 'folke/tokyonight.nvim', + as = 'tokyonight', + config = function() + vim.cmd('colorscheme tokyonight') + end + }) +end) diff --git a/lua/anth64/remap.lua b/lua/anth64/remap.lua new file mode 100644 index 0000000..b760350 --- /dev/null +++ b/lua/anth64/remap.lua @@ -0,0 +1,2 @@ +vim.g.mapleader = " " +vim.keymap.set("n", "pv", vim.cmd.Ex) diff --git a/lua/anth64/set.lua b/lua/anth64/set.lua new file mode 100644 index 0000000..141b8ec --- /dev/null +++ b/lua/anth64/set.lua @@ -0,0 +1,32 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80" + +vim.g.mapleader = " "