From 4d4fdb1d25fe90699941a3f1e948851343aaf973 Mon Sep 17 00:00:00 2001 From: surdeus Date: Sun, 27 Aug 2023 13:31:42 +0300 Subject: [PATCH] Improved coloring and indentation. --- nvim/colors/jien.vim | 60 ++++++++++++++++++++++++++++------------ nvim/init.lua | 11 +++++--- nvim/lua/indent.lua | 37 +++++++++++++++++++++++++ nvim/lua/maps.lua | 7 +++-- nvim/lua/plugin/tree.lua | 1 + 5 files changed, 92 insertions(+), 24 deletions(-) create mode 100644 nvim/lua/indent.lua diff --git a/nvim/colors/jien.vim b/nvim/colors/jien.vim index 9293ac1..81e9ee6 100644 --- a/nvim/colors/jien.vim +++ b/nvim/colors/jien.vim @@ -8,44 +8,68 @@ endif " highlight clear let colors_name = "jien" +" Main hi Normal guibg=black guifg=lightgray -hi Cursor gui=reverse -hi TermCursor guibg=red -hi CursorLine gui=bold guifg=none guibg=none -hi VertSplit gui=bold guifg=yellow +" Cursor +hi Cursor gui=none guifg=red +hi iCursor gui=bold guifg=black guibg=red +hi TermCursor guibg=red +hi CursorLine gui=bold guifg=none guibg=none + +" Information +hi Title gui=none guifg=white guibg=gray +hi TitleSel gui=bold guifg=white guibg=black +hi VertSplit gui=bold guifg=gray +hi StatusLine gui=bold guifg=white guibg=green +hi StatusLineNC gui=none guifg=black guibg=lightgray + +" Tabs +hi TabLine gui=none guibg=lightgray guifg=black +hi TabLineSel gui=bold guifg=white guibg=green +hi TabLineFill guifg=darkgray + +" Search and comments +hi IncSearch gui=bold guifg=black guibg=magenta +hi Search gui=none guifg=black guibg=magenta +hi Comment gui=none guifg=magenta + +" Popup +hi Pmenu gui=none guifg=black guibg=magenta + +" Folding hi Folded gui=none guifg=black guibg=green hi FoldColumn gui=none guifg=yellow guibg=white -hi IncSearch gui=none guifg=yellow ctermbg=green + +" Line number hi LineNr guibg=white guifg=black hi ModeMsg cterm=none ctermfg=black ctermbg=yellow hi MoreMsg cterm=none ctermfg=darkgreen ctermbg=none hi NonText cterm=none ctermfg=darkgrey ctermbg=none hi Question cterm=none ctermfg=green ctermbg=none -hi Search cterm=none ctermfg=black ctermbg=yellow hi SpecialKey cterm=none ctermfg=darkgreen ctermbg=none -hi StatusLine gui=bold guifg=black guibg=red -hi StatusLineNC guifg=gray -hi Title guifg=yellow -hi Statement gui=none guifg=magenta hi Visual gui=reverse hi WarningMsg cterm=none ctermfg=1 ctermbg=none +hi Statement gui=none guifg=yellow +hi Function gui=none guifg=yellow guibg=none + hi String guifg=red hi Constant guifg=red +hi Special guifg=blue -hi Comment guifg=yellow -hi Special guifg=lightblue hi Identifier gui=bold guifg=lightgreen -hi Include gui=bold guifg=red -hi PreProc cterm=none ctermfg=red ctermbg=none -hi Operator guifg=lightblue -hi Define cterm=none ctermfg=red ctermbg=none + hi Type guifg=lightgreen cterm=none ctermfg=green ctermbg=none -hi Function gui=none guifg=darkmagenta guibg=none hi Structure gui=none guifg=green guibg=none +hi Operator guifg=lightblue + +hi Include gui=bold guifg=red +hi PreProc gui=none guifg=red guibg=none +hi Define cterm=none ctermfg=red ctermbg=none + hi Ignore cterm=none ctermfg=7 ctermbg=none hi Directory cterm=none ctermfg=darkcyan ctermbg=none hi ErrorMsg cterm=none ctermfg=7 ctermbg=1 @@ -55,6 +79,6 @@ hi DiffAdd ctermbg=4 ctermfg=none ctermbg=none hi DiffChange ctermbg=5 ctermfg=none ctermbg=none hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 hi DiffText cterm=bold ctermfg=none ctermbg=1 -hi Underlined cterm=underline ctermfg=5 ctermbg=none +hi Underlined guifg=underlined hi Error cterm=none ctermfg=7 ctermbg=1 ctermbg=none hi SpellErrors cterm=bold ctermfg=7 ctermbg=1 ctermbg=none diff --git a/nvim/init.lua b/nvim/init.lua index 870a47d..e2c2dd8 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,7 +1,7 @@ -vim.o.smarttab = true +-- Surdeus init file. +-- surdeus@gmail.com -vim.o.swapfile = false -vim.o.tabstop = 4 +vim.opt.swapfile = false vim.o.number = true vim.o.cursorline = true @@ -10,6 +10,7 @@ vim.api.nvim_cmd({ args = {'jien'}, }, {}) +require("indent") require("maps") -- Do not put basic things after it, @@ -39,7 +40,6 @@ require("lazy").setup(plugins, opts) vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 vim.opt.termguicolors = true -require("nvim-tree").setup() require("nvim-tree").setup({ sort_by = "case_sensitive", view = { @@ -51,6 +51,9 @@ require("nvim-tree").setup({ filters = { dotfiles = false, }, + git = { + enable=false, + }, }) diff --git a/nvim/lua/indent.lua b/nvim/lua/indent.lua new file mode 100644 index 0000000..4f0c30d --- /dev/null +++ b/nvim/lua/indent.lua @@ -0,0 +1,37 @@ + +vim.o.autoindent = true +vim.o.expandtab = false +vim.o.tabstop = 4 +vim.o.shiftwidth = 4 + +createAutoCmd = vim.api.nvim_create_autocmd + +createAutoCmd({ + "BufNewFile", + "BufRead", +},{ + pattern = "*.js,*.jsx,*.scss,*.css,*.html,*.tmpl,*.tpl", + callback = function() + local buf = vim.bo[vim.api.nvim_get_current_buf()] + buf.expandtab = true + buf.shiftwidth=2 + buf.tabstop=2 + buf.softtabstop = 0 + end, +}) + +createAutoCmd({ + "BufNewFile", + "BufRead", +},{ + pattern = "*.md,*.py", + callback = function() + local buf = vim.bo[vim.api.nvim_get_current_buf()] + buf.expandtab = true + buf.shiftwidth=4 + buf.tabstop=4 + buf.softtabstop = 0 + end, +}) + + diff --git a/nvim/lua/maps.lua b/nvim/lua/maps.lua index e8ebc41..a7cf589 100644 --- a/nvim/lua/maps.lua +++ b/nvim/lua/maps.lua @@ -1,4 +1,5 @@ +vim.o.timeout = false -- Key mapping local map = vim.api.nvim_set_keymap @@ -8,6 +9,8 @@ local opts = {noremap = true, silent = true} map('n', '\\econf', ':e $HOME/lib/nvim/init.lua\n', opts) map('n', '\\rmap', ':source $HOME/lib/nvim/lua/maps.lua\n', opts) map('n', '\\emap', ':e $HOME/lib/nvim/lua/maps.lua\n', opts) + map('n', '\\rcolor', ':colorscheme jien\n', opts) + map('n', '\\ecolor', ':e $HOME/lib/nvim/colors/jien.vim\n', opts) -- File tree.s map('n', '\\home', ":cd $HOME | NvimTreeClose | NvimTreeOpen .;\n", opts) @@ -18,7 +21,7 @@ local opts = {noremap = true, silent = true} map('n', '\\tn', ':tabnew\n', opts) -- Line - map('n', '\\nl', ':if &cursorline==1set nocursorlineelse set cursorelineendif', opts) + -- map('n', '\\nl', ':if &cursorline==1set nocursorlineelse set cursorelineendif', opts) -- Windows -- Moving @@ -30,7 +33,7 @@ local opts = {noremap = true, silent = true} -- Resizing map('n', '', '+', opts) map('n', '', '-', opts) - map('n', '', '3<', opts) + map('n', '', '3<', opts) map('n', '', '3>', opts) -- Splitting map('n', '\\|', 'v', opts) diff --git a/nvim/lua/plugin/tree.lua b/nvim/lua/plugin/tree.lua index 1a56d5b..7d13ea2 100644 --- a/nvim/lua/plugin/tree.lua +++ b/nvim/lua/plugin/tree.lua @@ -2,6 +2,7 @@ return { "nvim-tree/nvim-tree.lua", git = { disable = true, + enable = false, }, version = "*", lazy = false,