chore(config): use iceberg for neovim

main
sudo pacman -Syu 2022-09-21 10:37:23 +07:00
parent 49351dd3b2
commit e9e7bb356e
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 111 additions and 166 deletions

View File

@ -1,194 +1,139 @@
-- https://github.com/nanotee/nvim-lua-guide -- https://github.com/nanotee/nvim-lua-guide
vim.opt.completeopt = { "menuone", "noinsert", "noselect" }
vim.opt.swapfile = false
vim.opt.title = true
vim.opt.virtualedit = "block" vim.opt.virtualedit = "block"
vim.opt.whichwrap = "<,>,[,]" vim.opt.whichwrap = "<,>,[,]"
-- https://github.com/vscode-neovim/vscode-neovim -- Line number
if not vim.g.vscode then vim.opt.number = true
vim.opt.completeopt = { "menuone", "noinsert", "noselect" } vim.opt.relativenumber = true
vim.opt.swapfile = false vim.opt.scrolloff = 4
vim.opt.title = true
-- Line number -- Tab
vim.opt.number = true vim.opt.tabstop = 4
vim.opt.relativenumber = true vim.opt.shiftwidth = 4
vim.opt.scrolloff = 4 vim.opt.expandtab = true
-- Tab -- Wrap
vim.opt.tabstop = 4 vim.opt.breakindent = true
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
-- Wrap -- Truecolor
vim.opt.breakindent = true if vim.env.COLORTERM == "truecolor" then
vim.opt.termguicolors = true
end
-- Truecolor -- Clipboard support
if vim.env.COLORTERM == "truecolor" then vim.opt.clipboard:append({ "unnamedplus" })
vim.opt.termguicolors = true
end
-- Clipboard support -- Mouse support
vim.opt.clipboard:append({ "unnamedplus" }) vim.opt.mouse = "a"
-- Mouse support -- Workaround
vim.opt.mouse = "a" -- https://github.com/neovim/neovim/issues/16416
vim.keymap.set("i", "<C-c>", "<Esc>")
-- GUI support -- Disable showmode when use lualine
vim.opt.guifont = { vim.opt.showmode = false
"APL385 Unicode:h18",
"Agave:h18",
"Victor Mono:h18",
"Rec Mono Casual:h18",
"Cascadia Code:h18",
"JetBrains Mono:h18",
"Iosevka:h18",
"Fira Code:h18",
}
-- Workaround -- Keymap
-- https://github.com/neovim/neovim/issues/16416 vim.keymap.set("n", "<leader>s", ":w<CR>")
vim.keymap.set("i", "<C-c>", "<Esc>") vim.keymap.set("n", "<leader>q", ":FZF<CR>")
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>")
vim.keymap.set("n", "<leader>r", ":NvimTreeRefresh<CR>")
vim.keymap.set("n", "<leader>n", ":NvimTreeFindFile<CR>")
vim.keymap.set("n", "<leader>z", ":TZAtaraxis<CR>")
vim.keymap.set("n", "<leader>f", ":Neoformat<CR>")
-- Disable showmode when use lualine -- Use vim-go
vim.opt.showmode = false vim.g.go_gopls_gofumpt = 1
vim.g.go_doc_popup_window = 1
-- Keymap -- Use copilot
vim.keymap.set("n", "<leader>s", ":w<CR>") vim.g.copilot_filetypes = {
vim.keymap.set("n", "<leader>q", ":FZF<CR>") ["*"] = false,
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>") go = true,
vim.keymap.set("n", "<leader>r", ":NvimTreeRefresh<CR>") proto = true,
vim.keymap.set("n", "<leader>n", ":NvimTreeFindFile<CR>") yaml = true,
vim.keymap.set("n", "<leader>z", ":TZAtaraxis<CR>") }
vim.keymap.set("n", "<leader>f", ":Neoformat<CR>")
-- Use catppuccin -- Use fzf
vim.g.catppuccin_flavour = "mocha" vim.opt.rtp:append({ "~/.fzf" })
-- Use vim-go -- https://github.com/wbthomason/packer.nvim
vim.g.go_gopls_gofumpt = 1 require("packer").startup(function()
vim.g.go_doc_popup_window = 1 -- Manage itself
use("wbthomason/packer.nvim")
-- Use copilot -- https://github.com/axelf4/vim-strip-trailing-whitespace
vim.g.copilot_filetypes = { use("axelf4/vim-strip-trailing-whitespace")
["*"] = false,
go = true,
proto = true,
yaml = true,
}
-- Use fzf -- https://github.com/nvim-lualine/lualine.nvim
vim.opt.rtp:append({ "~/.fzf" }) use({
"nvim-lualine/lualine.nvim",
config = function()
require("lualine").setup({
options = {
icons_enabled = false,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
},
extensions = { "fzf", "nvim-tree" },
})
end,
})
-- https://github.com/wbthomason/packer.nvim -- https://github.com/kyazdani42/nvim-tree.lua
require("packer").startup(function() use({
-- Manage itself "kyazdani42/nvim-tree.lua",
use("wbthomason/packer.nvim") config = function()
require("nvim-tree").setup({
-- https://github.com/axelf4/vim-strip-trailing-whitespace renderer = {
use("axelf4/vim-strip-trailing-whitespace") icons = {
show = {
-- https://github.com/nvim-lualine/lualine.nvim file = false,
use({ folder = false,
"nvim-lualine/lualine.nvim", folder_arrow = false,
config = function() git = false,
local lualine_theme = require("lualine.themes.iceberg")
if vim.opt.termguicolors then
lualine_theme = require("lualine.themes.catppuccin")
end
require("lualine").setup({
options = {
icons_enabled = false,
theme = lualine_theme,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
},
extensions = { "fzf", "nvim-tree" },
})
end,
})
-- https://github.com/kyazdani42/nvim-tree.lua
use({
"kyazdani42/nvim-tree.lua",
config = function()
require("nvim-tree").setup({
renderer = {
icons = {
show = {
file = false,
folder = false,
folder_arrow = false,
git = false,
},
}, },
}, },
git = { },
enable = true, git = {
ignore = true, enable = true,
}, ignore = true,
filters = { },
custom = { "^\\.git$" }, filters = {
}, custom = { "^\\.git$" },
}) },
end, })
}) end,
})
-- https://github.com/lukas-reineke/indent-blankline.nvim -- https://github.com/lukas-reineke/indent-blankline.nvim
use({ use({
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
config = function() config = function()
require("indent_blankline").setup() require("indent_blankline").setup()
end, end,
}) })
-- https://github.com/junegunn/fzf.vim -- https://github.com/junegunn/fzf.vim
use("junegunn/fzf.vim") use("junegunn/fzf.vim")
-- https://github.com/Pocco81/true-zen.nvim -- Colorschemes
use({ -- https://github.com/cocopon/iceberg.vim
"Pocco81/true-zen.nvim", use("cocopon/iceberg.vim")
config = function()
require("true-zen").setup()
end,
})
-- Colorschemes -- Programming languages
-- https://github.com/cocopon/iceberg.vim -- https://github.com/sbdchd/neoformat
use("cocopon/iceberg.vim") use("sbdchd/neoformat")
-- https://github.com/junegunn/seoul256.vim -- https://github.com/fatih/vim-go
use("junegunn/seoul256.vim") use("fatih/vim-go")
-- https://github.com/catppuccin/nvim -- https://github.com/github/copilot.vim
use({ use("github/copilot.vim")
"catppuccin/nvim", end)
as = "catppuccin",
config = function()
local catppuccin_term_colors = false
if vim.opt.termguicolors then
catppuccin_term_colors = true
end
require("catppuccin").setup({ vim.cmd([[ colorscheme iceberg ]])
term_colors = catppuccin_term_colors,
})
end,
})
-- Programming languages
-- https://github.com/sbdchd/neoformat
use("sbdchd/neoformat")
-- https://github.com/fatih/vim-go
use("fatih/vim-go")
-- https://github.com/github/copilot.vim
use("github/copilot.vim")
end)
if vim.opt.termguicolors then
vim.cmd([[ colorscheme catppuccin ]])
else
vim.cmd([[ colorscheme iceberg ]])
end
end