diff --git a/init.lua b/init.lua index cec3084e..ec0f30f1 100644 --- a/init.lua +++ b/init.lua @@ -147,24 +147,10 @@ require('lazy').setup({ 'navarasu/onedark.nvim', priority = 1000, config = function() - vim.cmd.colorscheme 'onedark' + vim.cmd.colorscheme 'onedark_dark' end, }, - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, - }, - { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', @@ -221,7 +207,7 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] @@ -272,8 +258,8 @@ vim.o.termguicolors = true vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +-- vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +-- vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` @@ -450,8 +436,8 @@ local servers = { -- clangd = {}, -- gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, + rust_analyzer = {}, + tsserver = {}, -- html = { filetypes = { 'html', 'twig', 'hbs'} }, lua_ls = { diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..d271227f --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,15 @@ +return { + "windwp/nvim-autopairs", + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require("nvim-autopairs").setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + local cmp = require('cmp') + cmp.event:on( + 'confirm_done', + cmp_autopairs.on_confirm_done() + ) + end, +} diff --git a/lua/custom/plugins/devicons.lua b/lua/custom/plugins/devicons.lua new file mode 100644 index 00000000..cc7bf131 --- /dev/null +++ b/lua/custom/plugins/devicons.lua @@ -0,0 +1,33 @@ +return { + "nvim-web-devicons", + config = function () + require 'nvim-web-devicons'.setup { + override = { + zsh = { + icon = "", + color = "#428850", + cterm_color = "65", + name = "Zsh" + } + }, + color_icons = true, + default = true, + strict = true, + override_by_filename = { + [".gitignore"] = { + icon = "", + color = "#f1502f", + name = "Gitignore" + } + }, + override_by_extension = { + ["log"] = { + icon = "", + color = "#81e043", + name = "Log" + } + }, + } + + end +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 00000000..e23d1107 --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,23 @@ +vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + +return { + "nvim-neo-tree/neo-tree.nvim", + version = "*", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + }, + config = function () + require('neo-tree').setup { + window = { + width = 30, + mappings = { + ["o"] = "open", + ["sv"] = "open_vsplit", + } + } + } + vim.keymap.set('n', 'sn', ':Neotree filesystem reveal float git_status', { noremap = true, silent = true }) + end, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..776c3f07 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,41 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + "olimorris/onedarkpro.nvim", + config = function () + local keymap = vim.keymap + + -- select all + keymap.set('n', '', 'ggG') + + -- always center + keymap.set('n', 'j', 'jzz', { noremap = false, silent = true }) + keymap.set('n', 'k', 'kzz', { noremap = false, silent = true }) + + -- escape insert mode + keymap.set('i', 'jj', '', { noremap = true, silent = true }) + + -- split remaps + keymap.set('n', 'ss', ':splitw') + keymap.set('n', 'sv', ':vsplitw') + keymap.set('n', '', 'w') + keymap.set('', 'sh', 'h') + keymap.set('', 'sk', 'k') + keymap.set('', 'sj', 'j') + keymap.set('', 'sl', 'l') + + -- Resize window + keymap.set('n', 's,', '<') + keymap.set('n', 's.', '>') + keymap.set('n', 's=', '+') + keymap.set('n', 's-', '-') + + -- quit + keymap.set('n', 'q', ':q', { silent = true }) + keymap.set('n', 'Q', ':q!', { silent = true }) + + -- save + keymap.set('n', 'sw', ':w', { silent = true }) + end +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000..405f6756 --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,16 @@ +local custom_onedark = require 'lualine.themes.onedark_dark' +custom_onedark.normal.c.bg = '#000000' + +return { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = true, + theme = custom_onedark, + section_separators = { left = '', right = '' }, + component_separators = { left = '', right = '' }, + }, + }, +} diff --git a/lua/custom/plugins/tabline.lua b/lua/custom/plugins/tabline.lua new file mode 100644 index 00000000..69d6c8dc --- /dev/null +++ b/lua/custom/plugins/tabline.lua @@ -0,0 +1,24 @@ +return { + "kdheepak/tabline.nvim", + config = function() + require 'tabline'.setup { + enable = true, + options = { + section_separators = { '', '' }, + component_separators = { '', '' }, + max_bufferline_percent = 66, -- set to nil by default, and it uses vim.o.columns * 2/3 + show_tabs_always = false, -- this shows tabs only when there are more than one tab or if the first tab is named + show_devicons = true, -- this shows devicons in buffer section + show_bufnr = false, -- this appends [bufnr] to buffer section, + show_filename_only = false, -- shows base filename only instead of relative path in filename + modified_icon = "+ ", -- change the default modified icon + modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified + show_tabs_only = false, -- this shows only tabs instead of tabs + buffers + } + } + + vim.keymap.set('n', '', 'TablineBufferNext', {}) + vim.keymap.set('n', '', 'TablineBufferPrev', {}) + vim.keymap.set('n', ';x', ':bpspbnbd', { noremap = true, silent = true }) + end, +}