update: nvim config: replace \t with space

This commit is contained in:
qwjyh 2023-03-11 10:15:33 +09:00
parent f84c77c78d
commit 7aae99d19f
2 changed files with 66 additions and 66 deletions

View file

@ -28,16 +28,16 @@ vim.o.smartcase = true
-- vim script func returns 1/0, while lua evals false only if gets false or nil -- vim script func returns 1/0, while lua evals false only if gets false or nil
-- so be sure to compare with 1/0 -- so be sure to compare with 1/0
if vim.fn.has('win32') == 1 then if vim.fn.has('win32') == 1 then
if vim.fn.executable('pwsh') == 1 then if vim.fn.executable('pwsh') == 1 then
vim.opt.shell = 'pwsh' vim.opt.shell = 'pwsh'
else else
vim.opt.shell = 'powershell' vim.opt.shell = 'powershell'
end end
vim.opt.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' vim.opt.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait' vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
vim.opt.shellquote = '' vim.opt.shellquote = ''
vim.opt.shellxquote = '' vim.opt.shellxquote = ''
end end
@ -52,18 +52,18 @@ vim.cmd [[autocmd BufWritePost plugins.lua PackerCompile]]
-- 1. LSP Sever management -- 1. LSP Sever management
--require('mason').setup() --require('mason').setup()
--require('mason-lspconfig').setup_handlers({ function(server) --require('mason-lspconfig').setup_handlers({ function(server)
-- local opt = { -- local opt = {
-- -- -- Function executed when the LSP server startup -- -- -- Function executed when the LSP server startup
-- -- on_attach = function(client, bufnr) -- -- on_attach = function(client, bufnr)
-- -- local opts = { noremap=true, silent=true } -- -- local opts = { noremap=true, silent=true }
-- -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) -- -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
-- -- vim.cmd 'autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 1000)' -- -- vim.cmd 'autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 1000)'
-- -- end, -- -- end,
-- capabilities = require('cmp_nvim_lsp').update_capabilities( -- capabilities = require('cmp_nvim_lsp').update_capabilities(
-- vim.lsp.protocol.make_client_capabilities() -- vim.lsp.protocol.make_client_capabilities()
-- ) -- )
-- } -- }
-- require('lspconfig')[server].setup(opt) -- require('lspconfig')[server].setup(opt)
--end }) --end })
-- --
---- 2. build-in LSP function ---- 2. build-in LSP function
@ -82,7 +82,7 @@ vim.cmd [[autocmd BufWritePost plugins.lua PackerCompile]]
--vim.keymap.set('n', 'g[', '<cmd>lua vim.diagnostic.goto_prev()<CR>') --vim.keymap.set('n', 'g[', '<cmd>lua vim.diagnostic.goto_prev()<CR>')
---- LSP handlers ---- LSP handlers
--vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( --vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
-- vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false } -- vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false }
--) --)
---- Reference highlight ---- Reference highlight
--vim.cmd [[ --vim.cmd [[
@ -100,26 +100,26 @@ vim.cmd [[autocmd BufWritePost plugins.lua PackerCompile]]
---- 3. completion (hrsh7th/nvim-cmp) ---- 3. completion (hrsh7th/nvim-cmp)
--local cmp = require("cmp") --local cmp = require("cmp")
--cmp.setup({ --cmp.setup({
-- snippet = { -- snippet = {
-- expand = function(args) -- expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- vim.fn["vsnip#anonymous"](args.body)
-- end, -- end,
-- }, -- },
-- sources = { -- sources = {
-- { name = "nvim_lsp" }, -- { name = "nvim_lsp" },
-- -- { name = "buffer" }, -- -- { name = "buffer" },
-- -- { name = "path" }, -- -- { name = "path" },
-- }, -- },
-- mapping = cmp.mapping.preset.insert({ -- mapping = cmp.mapping.preset.insert({
-- ["<C-p>"] = cmp.mapping.select_prev_item(), -- ["<C-p>"] = cmp.mapping.select_prev_item(),
-- ["<C-n>"] = cmp.mapping.select_next_item(), -- ["<C-n>"] = cmp.mapping.select_next_item(),
-- ['<C-l>'] = cmp.mapping.complete(), -- ['<C-l>'] = cmp.mapping.complete(),
-- ['<C-e>'] = cmp.mapping.abort(), -- ['<C-e>'] = cmp.mapping.abort(),
-- ["<CR>"] = cmp.mapping.confirm { select = true }, -- ["<CR>"] = cmp.mapping.confirm { select = true },
-- }), -- }),
-- experimental = { -- experimental = {
-- ghost_text = true, -- ghost_text = true,
-- }, -- },
--}) --})
---- cmp.setup.cmdline('/', { ---- cmp.setup.cmdline('/', {
---- mapping = cmp.mapping.preset.cmdline(), ---- mapping = cmp.mapping.preset.cmdline(),
@ -143,8 +143,8 @@ vim.cmd [[autocmd BufWritePost plugins.lua PackerCompile]]
----------------------------------------------------------- -----------------------------------------------------------
-- Ctrl + P to invoke fzf file search -- Ctrl + P to invoke fzf file search
vim.api.nvim_set_keymap('n', '<c-P>', vim.api.nvim_set_keymap('n', '<c-P>',
"<cmd>lua require('fzf-lua').files()<CR>", "<cmd>lua require('fzf-lua').files()<CR>",
{ noremap = true, silent = true }) { noremap = true, silent = true })
----------------------------------------------------------- -----------------------------------------------------------
@ -152,6 +152,6 @@ vim.api.nvim_set_keymap('n', '<c-P>',
require('lualine_setup') require('lualine_setup')
lualine = require('lualine') lualine = require('lualine')
lualine.setup({ lualine.setup({
options = { theme = 'iceberg_dark' } options = { theme = 'iceberg_dark' }
}) })
lualine.setup() lualine.setup()

View file

@ -1,29 +1,29 @@
vim.cmd [[packadd packer.nvim]] vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function(use) return require('packer').startup(function(use)
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
-- fzf -- fzf
use { 'ibhagwan/fzf-lua', use { 'ibhagwan/fzf-lua',
-- optional icon -- optional icon
--requires = { 'kyazdan142/nvim-web/devicons' } -- not found --requires = { 'kyazdan142/nvim-web/devicons' } -- not found
} }
-- lualine(statusline) -- lualine(statusline)
use { use {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true } requires = { 'kyazdani42/nvim-web-devicons', opt = true }
} }
-- LSP -- LSP
use 'neovim/nvim-lspconfig' use 'neovim/nvim-lspconfig'
use "williamboman/mason.nvim" use "williamboman/mason.nvim"
use "williamboman/mason-lspconfig.nvim" use "williamboman/mason-lspconfig.nvim"
use "hrsh7th/nvim-cmp" use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp" use "hrsh7th/cmp-nvim-lsp"
use "hrsh7th/vim-vsnip" use "hrsh7th/vim-vsnip"
-- Julia -- Julia
use "JuliaEditorSupport/julia-vim" use "JuliaEditorSupport/julia-vim"
end) end)