Ver código fonte

Some lua touches (#587)

* a way with lua!!

* some! not all ;-(

* shortmess
maminou 4 anos atrás
pai
commit
d58b79b320
2 arquivos alterados com 8 adições e 8 exclusões
  1. 2 2
      lua/colorscheme.lua
  2. 6 6
      lua/settings.lua

+ 2 - 2
lua/colorscheme.lua

@@ -1,2 +1,2 @@
--- TODO is there a lua native way to do this?
-vim.cmd('colorscheme ' .. O.colorscheme)
+vim.g.colors_name = O.colorscheme
+vim.g.syntax = true

+ 6 - 6
lua/settings.lua

@@ -1,5 +1,5 @@
-vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object"
-vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|.
+vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object" 
+vim.opt.shortmess:append("c") -- Don't pass messages to |ins-completion-menu|.
 vim.cmd('set inccommand=split') -- Make substitution work in realtime
 vim.cmd('set inccommand=split') -- Make substitution work in realtime
 vim.o.hidden = O.hidden_files -- Required to keep multiple buffers open multiple buffers
 vim.o.hidden = O.hidden_files -- Required to keep multiple buffers open multiple buffers
 vim.o.title = true
 vim.o.title = true
@@ -8,7 +8,6 @@ vim.cmd('let &titleold="'..TERMINAL..'"')
 vim.o.titlestring="%<%F%=%l/%L - nvim"
 vim.o.titlestring="%<%F%=%l/%L - nvim"
 vim.wo.wrap = O.wrap_lines -- Display long lines as just one line
 vim.wo.wrap = O.wrap_lines -- Display long lines as just one line
 vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
 vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
-vim.cmd('syntax on') -- syntax highlighting
 vim.o.pumheight = 10 -- Makes popup menu smaller
 vim.o.pumheight = 10 -- Makes popup menu smaller
 vim.o.fileencoding = "utf-8" -- The encoding written to file
 vim.o.fileencoding = "utf-8" -- The encoding written to file
 vim.o.cmdheight = 2 -- More space for displaying messages
 vim.o.cmdheight = 2 -- More space for displaying messages
@@ -19,9 +18,10 @@ vim.o.termguicolors = true -- set term gui colors most terminals support this
 vim.o.splitright = true -- Vertical splits will automatically be to the right
 vim.o.splitright = true -- Vertical splits will automatically be to the right
 -- vim.o.t_Co = "256" -- Support 256 colors
 -- vim.o.t_Co = "256" -- Support 256 colors
 vim.o.conceallevel = 0 -- So that I can see `` in markdown files
 vim.o.conceallevel = 0 -- So that I can see `` in markdown files
-vim.cmd('set ts=4') -- Insert 2 spaces for a tab
-vim.cmd('set sw=4') -- Change the number of space characters inserted for indentation
-vim.cmd('set expandtab') -- Converts tabs to spaces
+vim.opt.tabstop = 4 -- Insert 2 spaces for a tab
+vim.opt.shiftwidth = 4 -- Change the number of space characters inserted for indentation
+--vim.opt.softtabstop = 4
+vim.opt.expandtab = true -- Converts tabs to spaces
 vim.o.completeopt = "menuone,noselect"
 vim.o.completeopt = "menuone,noselect"
 vim.bo.smartindent = true -- Makes indenting smart
 vim.bo.smartindent = true -- Makes indenting smart
 vim.wo.number = O.number -- set numbered lines
 vim.wo.number = O.number -- set numbered lines