From 2677a36ab948c943bdc0cb0643668ba10de4f3d9 Mon Sep 17 00:00:00 2001 From: Juni Kim Date: Tue, 31 Jan 2023 14:34:30 -0500 Subject: [PATCH] lualine+lsp --- after/plugin/lsp.lua | 1 + after/plugin/lualine.lua | 3 ++- lua/junikim/packer.lua | 11 ----------- lua/junikim/remap.lua | 38 +++++++++++++++----------------------- 4 files changed, 18 insertions(+), 35 deletions(-) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 18d6851..91d549f 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -45,6 +45,7 @@ lsp.configure("efm", { 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", "rn", function() vim.lsp.buf.rename() end, opts) end) diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua index 2560358..0e59244 100644 --- a/after/plugin/lualine.lua +++ b/after/plugin/lualine.lua @@ -6,7 +6,8 @@ require('lualine').setup { options = { icons_enabled = true, --theme = 'auto', - theme = 'onedark', + --theme = 'onedark', + theme = "catppuccin", --component_separators = { left = '', right = '' }, --component_separators = { left = '', right = '' }, --section_separators = { left = '', right = '' }, diff --git a/lua/junikim/packer.lua b/lua/junikim/packer.lua index f7fec77..7eb1a1d 100644 --- a/lua/junikim/packer.lua +++ b/lua/junikim/packer.lua @@ -9,17 +9,6 @@ return require('packer').startup(function(use) } use 'Townk/vim-autoclose' use { "catppuccin/nvim", as = "catppuccin" } ---[[ - use { "jonstoler/werewolf.vim", config = function() - -- default 8, use 24 hour format - vim.g.werewolf_day_start = 8 - vim.g.werewolf_day_end = 18 - -- werewolf - vim.g.werewolf_day_themes = { 'catppuccin-latte' } - vim.g.werewolf_night_themes = { 'catppuccin-mocha' } - end - } - ]]-- use( 'nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' } ) diff --git a/lua/junikim/remap.lua b/lua/junikim/remap.lua index 8d53d7b..4d6b1a4 100644 --- a/lua/junikim/remap.lua +++ b/lua/junikim/remap.lua @@ -1,29 +1,21 @@ -local function map(mode, lhs, rhs, opts) - local options = { noremap = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.api.nvim_set_keymap(mode, lhs, rhs, options) -end - vim.g.mapleader = " " -map("n", "j", "gj") -map("n", "k", "gk") +vim.keymap.set("n", "j", "gj") +vim.keymap.set("n", "k", "gk") -map("n", "", "h") -map("n", "", "j") -map("n", "", "k") -map("n", "", "l") +vim.keymap.set("n", "", "h") +vim.keymap.set("n", "", "j") +vim.keymap.set("n", "", "k") +vim.keymap.set("n", "", "l") -map("i", "", "ā") -map("i", "", "ē") -map("i", "", "ī") -map("i", "", "ō") -map("i", "", "ū") +vim.keymap.set("i", "", "ā") +vim.keymap.set("i", "", "ē") +vim.keymap.set("i", "", "ī") +vim.keymap.set("i", "", "ō") +vim.keymap.set("i", "", "ū") -map("n", "", ":w|:!texbld run compile") -map("n", "", ":w|:!./test.sh") +vim.keymap.set("n", "", ":w|:!texbld run compile") +vim.keymap.set("n", "", ":w|:!./test.sh") -- hacks vim.keymap.set("v", "J", ":m '>+1gv=gv") @@ -43,18 +35,18 @@ vim.keymap.set("n", "X", "!chmod -x %", { silent = true }) -- execute file -vim.keymap.set("n", ",", "e ~/.config/nvim"); vim.keymap.set("n", "r", "so ~/.config/nvim/init.lua") vim.keymap.set("n", "e", "!%:p", { silent = true }) vim.keymap.set("n", "vz", "e ~/.zshrc"); +vim.keymap.set("n", "vc", "e ~/.config/nvim"); vim.keymap.set("n", "fmt", function() vim.lsp.buf.formatting_sync() end) if os.getenv("TMUX") ~= nil then - vim.keymap.set("n", "", [[silent !tmux neww "zsh -c '. ~/.zshenv; tmuxs'"]]) + vim.keymap.set("n", "", [[silent !tmux neww tmuxs\; setenv WORKSPACES $WORKSPACES \;]]) vim.keymap.set("n", "", [[silent !tmux neww ncmpcpp]]) else local function unavailable()