From 548dc66bc3153df11bbbc20ca5a4b97d57f0ef09 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 15 Oct 2021 22:32:20 +0300 Subject: nvim: lualine fork + indentline + rose pine --- .config/nvim/after/ftplugin/ledger.vim | 2 +- .config/nvim/lua/mappings.lua | 6 +++-- .config/nvim/lua/plugin_settings.lua | 46 +++++++++++++++++++++++++------- .config/nvim/lua/plugins.lua | 9 ++++--- .config/nvim/my_snippets/ledger.snippets | 7 +++++ 5 files changed, 53 insertions(+), 17 deletions(-) diff --git a/.config/nvim/after/ftplugin/ledger.vim b/.config/nvim/after/ftplugin/ledger.vim index 5785c35..022bcac 100644 --- a/.config/nvim/after/ftplugin/ledger.vim +++ b/.config/nvim/after/ftplugin/ledger.vim @@ -1,3 +1,3 @@ -let b:dispatch = 'ledger -f ~/nextcloud/ledger.ledger bal assets liab' +let b:dispatch = 'ledger -f ~/nextcloud/virtuals/ledger.ledger bal assets liab' set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index 63eb045..6c17177 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -12,7 +12,6 @@ local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, options) end --- local map = vim.api.nvim_set_keymap local cmd = vim.cmd local M = {} @@ -159,10 +158,13 @@ map('n', 'fh', "lua require('telescope.builtin').help_tags()") map('n', '', ":Vista focus") map('n', '', ":Vista finder") - +-- dashboard map('n', 'fh', ':DashboardFindHistory') map('n', 'ff', ':DashboardFindFile') map('n', 'fa', ':DashboardFindWord') map('n', 'fb', ':DashboardJumpMark') map('n', 'cn', ':DashboardNewFile') + +-- toggle rose pine theme +map('n', 'cz', [[lua require('rose-pine.functions').toggle_variant({'dawn', 'base'})]], { noremap = true, silent = true }) -- }}} plug mappings -- diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index 63cb370..2986c64 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua @@ -32,31 +32,40 @@ g.vimwiki_hl_headers = 1 local function lualine_spell() if vim.wo.spell then - return [[spell]] + return "spell" else return end end +local function lualine_spell_cond() + if vim.wo.spell then + return true + else + return false + end +end + require'lualine'.setup { options = { - lower = false, icons_enabled = true, theme = 'rose-pine', - section_separators = {'', ''}, - component_separators = {'', ''}, - disabled_filetypes = {} + section_separators = { left = '', right = '' }, + component_separators = { left = '', right = '' }, }, sections = { - lualine_a = {{'mode', lower = true}}, - lualine_b = {'branch', 'diff', {lualine_spell}}, + lualine_a = {{'mode', fmt = string.lower}}, + lualine_b = {'branch', 'diff', { + lualine_spell, + cond = lualine_spell_cond + }}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, lualine_z = { 'location', { 'diagnostics', - sources = {'ale'}, + sources = {'nvim_lsp'}, sections = {'error', 'warn', 'info', 'hint'}, symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} } @@ -70,7 +79,14 @@ require'lualine'.setup { lualine_y = {}, lualine_z = {} }, - tabline = {}, + tabline = { + lualine_a = {'buffers'}, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {'tabs'} + }, extensions = {} } @@ -102,7 +118,7 @@ g.UltiSnipsEditSplit = "vertical" -- ctrl + l expands the snippet, c + j/k navigates placeholders g.UltiSnipsExpandTrigger = "" g.UltiSnipsEnableSnipMate = "1" -g.UltiSnipsSnippetDirectories = {"my_snippets"} +g.UltiSnipsSnippetDirectories = {"my_snippets", "UltiSnips"} -- }}} UltiSnips -- -- beacon {{{ -- @@ -341,3 +357,13 @@ g.vista_icon_indent = {"╰ ", "│ "} g["float_preview#docked"] = 0 -- }}} float-preview.nvim -- +-- indent-blankline {{{ -- +vim.opt.list = true + +require("indent_blankline").setup { + show_current_context = true, + char = "┊", + buftype_exclude = {"terminal"}, + filetype_exclude = {"dashboard", "help", "ledger"} +} +-- }}} indent-blankline -- diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 93a5aa2..c9b6a7c 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -8,18 +8,17 @@ return require('packer').startup(function() -- packer can manage itself use 'wbthomason/packer.nvim' + -- latex suite use {'lervag/vimtex', ft = {'tex', 'latex', 'plaintext'}} - -- treesitter... + -- treesitter use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } - -- quickstart lsp config use 'neovim/nvim-lspconfig' - -- dashboard use 'glepnir/dashboard-nvim' @@ -51,6 +50,8 @@ return require('packer').startup(function() use 'airblade/vim-gitgutter' -- completion preview of floating window use 'ncm2/float-preview.nvim' + -- indent guides + use "lukas-reineke/indent-blankline.nvim" -- language packs use "nathom/filetype.nvim" @@ -126,7 +127,7 @@ return require('packer').startup(function() -- cursorline of the $CURRENT_YEAR use { - 'hoob3rt/lualine.nvim', + 'shadmansaleh/lualine.nvim', requires = {'kyazdani42/nvim-web-devicons', opt = true} } -- colour theme of the $CURRENT_YEAR diff --git a/.config/nvim/my_snippets/ledger.snippets b/.config/nvim/my_snippets/ledger.snippets index a8c4eb0..098a767 100644 --- a/.config/nvim/my_snippets/ledger.snippets +++ b/.config/nvim/my_snippets/ledger.snippets @@ -30,3 +30,10 @@ ${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Migro Expenses:Food:Groceries ${4:0.00} TL ${5:Assets:Maas}$0 endsnippet + +snippet sb "New Sosyal Bina Transaction" b +${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Sosyal Bina + Expenses:Food:Lunch 8.60 TL + Assets:Maas$0 +endsnippet + -- cgit v1.2.3-70-g09d2