Browse Source

lualine+lsp

imac
Juni Kim 2 years ago
parent
commit
2677a36ab9
  1. 1
      after/plugin/lsp.lua
  2. 3
      after/plugin/lualine.lua
  3. 11
      lua/junikim/packer.lua
  4. 38
      lua/junikim/remap.lua

1
after/plugin/lsp.lua

@ -45,6 +45,7 @@ lsp.configure("efm", {
lsp.on_attach(function(client, bufnr) lsp.on_attach(function(client, bufnr)
local opts = { buffer = bufnr, remap = false } local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "<leader>rn", function() vim.lsp.buf.rename() end, opts)
end) end)

3
after/plugin/lualine.lua

@ -6,7 +6,8 @@ require('lualine').setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
--theme = 'auto', --theme = 'auto',
theme = 'onedark',
--theme = 'onedark',
theme = "catppuccin",
--component_separators = { left = '', right = '' }, --component_separators = { left = '', right = '' },
--component_separators = { left = '', right = '' }, --component_separators = { left = '', right = '' },
--section_separators = { left = '', right = '' }, --section_separators = { left = '', right = '' },

11
lua/junikim/packer.lua

@ -9,17 +9,6 @@ return require('packer').startup(function(use)
} }
use 'Townk/vim-autoclose' use 'Townk/vim-autoclose'
use { "catppuccin/nvim", as = "catppuccin" } 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( use(
'nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' } 'nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }
) )

38
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 = " " 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", "<C-h>", "<C-w>h")
map("n", "<C-j>", "<C-w>j")
map("n", "<C-k>", "<C-w>k")
map("n", "<C-l>", "<C-w>l")
vim.keymap.set("n", "<C-h>", "<C-w>h")
vim.keymap.set("n", "<C-j>", "<C-w>j")
vim.keymap.set("n", "<C-k>", "<C-w>k")
vim.keymap.set("n", "<C-l>", "<C-w>l")
map("i", "<A-a>", "ā")
map("i", "<A-e>", "ē")
map("i", "<A-i>", "ī")
map("i", "<A-o>", "ō")
map("i", "<A-u>", "ū")
vim.keymap.set("i", "<A-a>", "ā")
vim.keymap.set("i", "<A-e>", "ē")
vim.keymap.set("i", "<A-i>", "ī")
vim.keymap.set("i", "<A-o>", "ō")
vim.keymap.set("i", "<A-u>", "ū")
map("n", "<F12>", ":w|:!texbld run compile<CR>")
map("n", "<F5>", ":w|:!./test.sh<CR>")
vim.keymap.set("n", "<F12>", ":w|:!texbld run compile<CR>")
vim.keymap.set("n", "<F5>", ":w|:!./test.sh<CR>")
-- hacks -- hacks
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
@ -43,18 +35,18 @@ vim.keymap.set("n", "<leader>X", "<cmd>!chmod -x %<CR>", { silent = true })
-- execute file -- execute file
vim.keymap.set("n", "<leader>,", "<cmd>e ~/.config/nvim<CR>");
vim.keymap.set("n", "<leader>r", "<cmd>so ~/.config/nvim/init.lua<CR>") vim.keymap.set("n", "<leader>r", "<cmd>so ~/.config/nvim/init.lua<CR>")
vim.keymap.set("n", "<leader>e", "<cmd>!%:p<CR>", { silent = true }) vim.keymap.set("n", "<leader>e", "<cmd>!%:p<CR>", { silent = true })
vim.keymap.set("n", "<leader>vz", "<cmd>e ~/.zshrc<CR>"); vim.keymap.set("n", "<leader>vz", "<cmd>e ~/.zshrc<CR>");
vim.keymap.set("n", "<leader>vc", "<cmd>e ~/.config/nvim<CR>");
vim.keymap.set("n", "<leader>fmt", function() vim.keymap.set("n", "<leader>fmt", function()
vim.lsp.buf.formatting_sync() vim.lsp.buf.formatting_sync()
end) end)
if os.getenv("TMUX") ~= nil then if os.getenv("TMUX") ~= nil then
vim.keymap.set("n", "<C-f>", [[<cmd>silent !tmux neww "zsh -c '. ~/.zshenv; tmuxs'"<CR>]])
vim.keymap.set("n", "<C-f>", [[<cmd>silent !tmux neww tmuxs\; setenv WORKSPACES $WORKSPACES \;<CR>]])
vim.keymap.set("n", "<C-y>", [[<cmd>silent !tmux neww ncmpcpp<CR>]]) vim.keymap.set("n", "<C-y>", [[<cmd>silent !tmux neww ncmpcpp<CR>]])
else else
local function unavailable() local function unavailable()

Loading…
Cancel
Save