From 11b04ad1e5ef81d42c4384af94d7ba4161f0c160 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Appel Date: Tue, 21 Feb 2023 01:04:26 -0500 Subject: Added nvim and tmux config --- nvim/after/plugin/keymap/explorer.lua | 9 ++++ nvim/after/plugin/keymap/telescope.lua | 24 ++++++++++ nvim/after/plugin/statusline.lua | 30 ++++++++++++ nvim/after/plugin/tabline.lua | 10 ++++ nvim/init.lua | 50 ++++++++++++++++++++ nvim/lua/colorscheme.lua | 1 + nvim/lua/keymap.lua | 22 +++++++++ nvim/lua/plugins.lua | 85 ++++++++++++++++++++++++++++++++++ nvim/lua/telescope.lua | 2 + 9 files changed, 233 insertions(+) create mode 100644 nvim/after/plugin/keymap/explorer.lua create mode 100644 nvim/after/plugin/keymap/telescope.lua create mode 100644 nvim/after/plugin/statusline.lua create mode 100644 nvim/after/plugin/tabline.lua create mode 100644 nvim/init.lua create mode 100644 nvim/lua/colorscheme.lua create mode 100644 nvim/lua/keymap.lua create mode 100644 nvim/lua/plugins.lua create mode 100644 nvim/lua/telescope.lua (limited to 'nvim') diff --git a/nvim/after/plugin/keymap/explorer.lua b/nvim/after/plugin/keymap/explorer.lua new file mode 100644 index 0000000..00ded39 --- /dev/null +++ b/nvim/after/plugin/keymap/explorer.lua @@ -0,0 +1,9 @@ +local Remap = require("keymap") + +-- TODO: move to separate config file +vim.g.netrw_liststyle = 3 +vim.g.netrw_banner = 0 + +Remap.nnoremap("ef", function() + vim.cmd('Vexplore') +end) diff --git a/nvim/after/plugin/keymap/telescope.lua b/nvim/after/plugin/keymap/telescope.lua new file mode 100644 index 0000000..f55ffec --- /dev/null +++ b/nvim/after/plugin/keymap/telescope.lua @@ -0,0 +1,24 @@ +local Remap = require("keymap") +local builtin = require('telescope.builtin') +local nnoremap = Remap.nnoremap + +-- find file +nnoremap("ff", function() + builtin.find_files() +end) + +-- find buffer +nnoremap("fb", function() + builtin.buffers() +end) + +-- grep find +nnoremap("gf", function() + builtin.live_grep() +end) + +-- -- find git, lists git pickers +-- TODO: write picker +-- nnoremap("fg", function() +-- builtin. +-- end) diff --git a/nvim/after/plugin/statusline.lua b/nvim/after/plugin/statusline.lua new file mode 100644 index 0000000..369ad7b --- /dev/null +++ b/nvim/after/plugin/statusline.lua @@ -0,0 +1,30 @@ +require('lualine').setup({ + options = { + theme = 'auto', + globalstatus = true, + }, + -- tabline = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = {}, + -- lualine_x = {}, + -- lualine_y = {}, + -- lualine_z = {} + -- }, + -- winbar = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = {'filename'}, + -- lualine_x = {}, + -- lualine_y = {}, + -- lualine_z = {} + -- }, + -- inactive_winbar = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = {'filename'}, + -- lualine_x = {'location'}, + -- lualine_y = {}, + -- lualine_z = {} + -- }, +}) diff --git a/nvim/after/plugin/tabline.lua b/nvim/after/plugin/tabline.lua new file mode 100644 index 0000000..c975d94 --- /dev/null +++ b/nvim/after/plugin/tabline.lua @@ -0,0 +1,10 @@ +require('bufferline').setup({ + options = { + mode = "tabs", + show_tab_indicators = false, + hover = { + enabled = true, + delay = 200 + } + } +}) diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..58e8625 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,50 @@ +-- ==================== +-- NVIM CONFIG +-- ==================== + +HOME = os.getenv("HOME") + +require('keymap') +require('plugins') +require('colorscheme') +-- require('statusline') +-- require('bufferline') + +-- General Config +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.cursorline = true +vim.opt.linebreak = true +vim.opt.title = true +vim.opt.showmatch = true +vim.opt.showmode = false +vim.opt.mouse = "anv" + +-- Status line +vim.opt.laststatus = 3 + +vim.opt.showtabline = 2 + +vim.opt.list = true +vim.opt.listchars = "tab:▸ ,trail:·,nbsp:·,extends:+,lead:·" + +-- tab settings +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.softtabstop = 4 +vim.opt.expandtab = true + +-- search +vim.opt.ignorecase = true +vim.opt.smartcase = true + +-- Bell +vim.opt.errorbells = false +vim.opt.visualbell = true + +-- term settings +vim.opt.termguicolors = true + + +-- leader +vim.g.mapleader = " " diff --git a/nvim/lua/colorscheme.lua b/nvim/lua/colorscheme.lua new file mode 100644 index 0000000..1d79a5f --- /dev/null +++ b/nvim/lua/colorscheme.lua @@ -0,0 +1 @@ +vim.cmd("colorscheme catppuccin-mocha") diff --git a/nvim/lua/keymap.lua b/nvim/lua/keymap.lua new file mode 100644 index 0000000..883321b --- /dev/null +++ b/nvim/lua/keymap.lua @@ -0,0 +1,22 @@ +-- Provides convienent lua methods for binding keys +-- Source: Primeagen +local M = {} + +local function bind(op, outer_opts) + outer_opts = outer_opts or {noremap = true} + return function(lhs, rhs, opts) + opts = vim.tbl_extend("force", + outer_opts, + opts or {} + ) + vim.keymap.set(op, lhs, rhs, opts) + end +end + +M.nmap = bind("n", {noremap = false}) +M.nnoremap = bind("n") +M.vnoremap = bind("v") +M.xnoremap = bind("x") +M.inoremap = bind("i") + +return M diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua new file mode 100644 index 0000000..47024bd --- /dev/null +++ b/nvim/lua/plugins.lua @@ -0,0 +1,85 @@ +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' -- package manager + use 'neovim/nvim-lspconfig' -- config for lsp + + -- common dependacy + use "nvim-lua/plenary.nvim" + + -- git + use 'tpope/vim-fugitive' -- close to native git command integrations + + + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', -- fuzzy finder + requires = { {'nvim-lua/plenary.nvim'}, {'nvim-tree/nvim-web-devicons'} } + } + + -- completion + -- TODO:config completion and setup binds + use 'hrsh7th/nvim-cmp' + use { + 'hrsh7th/cmp-nvim-lsp', + requires = { {'hrsh7th/nvim-cmp'}, {'neovim/nvim-lspconfig'} } + } + use { + 'hrsh7th/cmp-path', + requires = { 'hrsh7th/nvim-cmp' } + } + use { + 'kdheepak/cmp-latex-symbols', + requires = { 'hrsh7th/nvim-cmp' } + } + + + -- pandoc + use 'vim-pandoc/vim-pandoc' + use 'vim-pandoc/vim-pandoc-syntax' + + -- tree sitter + use { + 'nvim-treesitter/nvim-treesitter', + run = ':TSUpdate' + } + + use { + 'numToStr/Comment.nvim', -- faster commentting + config = function() + require('Comment').setup() + end + } + + use 'habamax/vim-godot' + + -- TODO: configure tree-sitter to color current indentation level + use { + 'lukas-reineke/indent-blankline.nvim', -- show indentation levels + config = function() + require('indent_blankline').setup { + show_current_context = true, + show_current_context_start = true + } + end + } + + -- statusline/bufferline + use { + 'nvim-lualine/lualine.nvim', -- lualine + requires = { 'nvim-tree/nvim-web-devicons', opt = true }, + config = function() + require('lualine').setup() + end + } + use { + 'akinsho/bufferline.nvim', -- bufferline + tag = "v3.*", + requires = 'nvim-tree/nvim-web-devicons', + config = function() + require('bufferline').setup() + end + } + + -- cosmetic + use { "catppuccin/nvim", as = "catppuccin" } -- colorscheme + -- use 'kyazdani42/nvim-web-devicons' + +end) diff --git a/nvim/lua/telescope.lua b/nvim/lua/telescope.lua new file mode 100644 index 0000000..37d03a3 --- /dev/null +++ b/nvim/lua/telescope.lua @@ -0,0 +1,2 @@ +-- require("telescope").setup({ +-- }) -- cgit v1.2.3