formatted code
This commit is contained in:
		
							parent
							
								
									da382b5d61
								
							
						
					
					
						commit
						4316ac84df
					
				|  | @ -25,7 +25,6 @@ vim.keymap.set('n', '<leader>u', '20k') | |||
| vim.keymap.set('v', '<leader>n', '20j') | ||||
| vim.keymap.set('v', '<leader>u', '20k') | ||||
| 
 | ||||
| 
 | ||||
| -- Alternate way to save | ||||
| vim.cmd('nnoremap <C-s> :w!<CR>') | ||||
| vim.cmd('inoremap <C-s> <ESC> :w!<CR>') | ||||
|  | @ -33,7 +32,6 @@ vim.cmd('inoremap <C-s> <ESC> :w!<CR>') | |||
| -- Alternate way to quit | ||||
| vim.cmd('nnoremap <S-c> :q!<CR>') | ||||
| 
 | ||||
| 
 | ||||
| -- ================= File management ================= -- | ||||
| 
 | ||||
| -- swapfile has global & local config, eventhough help says otherwise | ||||
|  | @ -103,8 +101,8 @@ vim.o.hidden = true | |||
| vim.o.clipboard = "unnamedplus" | ||||
| 
 | ||||
| -- diagnostic symbols | ||||
| local signs = { Error = "", Warn = "", Hint = "", Info = "" } | ||||
| local signs = {Error = "", Warn = "", Hint = "", Info = ""} | ||||
| for type, icon in pairs(signs) do | ||||
|   local hl = "DiagnosticSign" .. type | ||||
|     vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) | ||||
|   vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl}) | ||||
| end | ||||
|  |  | |||
|  | @ -2,5 +2,5 @@ return { | |||
|   "windwp/nvim-autopairs", | ||||
|   config = function() | ||||
|     require("nvim-autopairs").setup {} | ||||
|   end, | ||||
|   end | ||||
| } | ||||
|  |  | |||
|  | @ -1,10 +1,9 @@ | |||
| return { | ||||
|   'romgrk/barbar.nvim', | ||||
|   dependencies = 'nvim-tree/nvim-web-devicons', | ||||
|   config = function () | ||||
|   config = function() | ||||
|     vim.keymap.set('', 'J', '<Cmd>BufferPrevious<CR>') | ||||
|     vim.keymap.set('', 'K', '<Cmd>BufferNext<CR>') | ||||
|     vim.keymap.set('', 'X', '<Cmd>BufferClose<CR>') | ||||
|   end | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| return { | ||||
|   "rmehri01/onenord.nvim", | ||||
| 	config = function () | ||||
|   config = function() | ||||
|     vim.cmd.colorscheme 'onenord' | ||||
|   end | ||||
| } | ||||
|  |  | |||
|  | @ -1,8 +1,7 @@ | |||
| return { | ||||
|   'onsails/lspkind.nvim', | ||||
|   config = function () | ||||
| 
 | ||||
| 	local lspkind = require'lspkind' | ||||
|   config = function() | ||||
|     local lspkind = require 'lspkind' | ||||
| 
 | ||||
|     -- nvim-cmp setup | ||||
|     local cmp = require 'cmp' | ||||
|  | @ -15,7 +14,7 @@ return { | |||
| 
 | ||||
|           -- The function below will be called before any actual modifications from lspkind | ||||
|           -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) | ||||
| 		  before = function (entry, vim_item) | ||||
|           before = function(entry, vim_item) | ||||
|             return vim_item | ||||
|           end | ||||
|         }) | ||||
|  | @ -23,4 +22,3 @@ return { | |||
|     } | ||||
|   end | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -13,7 +13,7 @@ return { | |||
|   end, | ||||
|   dependencies = { | ||||
|     {"nvim-tree/nvim-web-devicons"}, | ||||
|       --Please make sure you install markdown and markdown_inline parser | ||||
|     -- Please make sure you install markdown and markdown_inline parser | ||||
|     {"nvim-treesitter/nvim-treesitter"} | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| return { | ||||
|   'nvim-lualine/lualine.nvim', | ||||
|   opts = { | ||||
| options = { | ||||
|     options = { | ||||
|       theme = 'onenord', | ||||
|       icons_enabled = true, | ||||
|       component_separators = {left = '', right = ''}, | ||||
|  | @ -36,6 +36,6 @@ options = { | |||
|       lualine_x = {'location'}, | ||||
|       lualine_y = {}, | ||||
|       lualine_z = {} | ||||
|   }, | ||||
|     }, | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| return { | ||||
|   "jose-elias-alvarez/null-ls.nvim", | ||||
|   dependencies = {"nvim-lua/plenary.nvim"}, | ||||
|   config = function () | ||||
|   config = function() | ||||
|     local null_ls = require("null-ls") | ||||
| 
 | ||||
|     local formatting = null_ls.builtins.formatting | ||||
|  | @ -11,7 +11,8 @@ return { | |||
|     local sources = { | ||||
|       formatting.eslint_d, formatting.prettierd.with({ | ||||
|         env = { | ||||
| 		  PRETTIERD_DEFAULT_CONFIG = vim.fn.expand "~/.config/nvim/utils/linter-config/.prettierrc.js" | ||||
|           PRETTIERD_DEFAULT_CONFIG = vim.fn | ||||
|               .expand "~/.config/nvim/utils/linter-config/.prettierrc.js" | ||||
|         } | ||||
|       }), -- formatting.prettier | ||||
|       --     .with({extra_args = {'--single-quote', '--tab-width 2', '--arrow-parens avoid'}}), | ||||
|  | @ -20,7 +21,8 @@ return { | |||
|           '--no-keep-simple-function-one-line', '--no-break-after-operator', '--column-limit=100', | ||||
|           '--break-after-table-lb', '--indent-width=2' | ||||
|         } | ||||
| 	  }), diagnostics.eslint_d.with({diagnostics_format = "[#{c}] #{m} (#{s})"}), codeActions.eslint_d | ||||
|       }), diagnostics.eslint_d.with({diagnostics_format = "[#{c}] #{m} (#{s})"}), | ||||
|       codeActions.eslint_d | ||||
|     } | ||||
| 
 | ||||
|     local lsp_formatting = function(bufnr) | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| return { | ||||
|   "rafamadriz/friendly-snippets", | ||||
|   config = function () | ||||
|   config = function() | ||||
|     require("luasnip/loaders/from_vscode").lazy_load() | ||||
|   end | ||||
| } | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| return { | ||||
|   'norcalli/nvim-colorizer.lua', | ||||
|   config = function () | ||||
|   config = function() | ||||
|     require'colorizer'.setup { | ||||
|       '*', -- Highlight all files, but customize some others. | ||||
|       css = {css = true} -- Enable parsing rgb(...) functions in css. | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| return { | ||||
|   'petertriho/nvim-scrollbar', | ||||
|   config = function () | ||||
|   config = function() | ||||
|     require("scrollbar").setup({ | ||||
|       handle = {text = "  "}, | ||||
|       marks = { | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| return { | ||||
|   'nvim-tree/nvim-tree.lua', | ||||
|   requires = { | ||||
|     'nvim-tree/nvim-web-devicons', -- optional, for file icons | ||||
|     'nvim-tree/nvim-web-devicons' -- optional, for file icons | ||||
|   }, | ||||
|   config = function() | ||||
|     local nvim_tree_events = require('nvim-tree.events') | ||||
|  | @ -29,10 +29,7 @@ return { | |||
|     require("nvim-tree").setup({ | ||||
|       sync_root_with_cwd = true, | ||||
|       respect_buf_cwd = true, | ||||
|       update_focused_file = { | ||||
|         enable = true, | ||||
|         update_root = true | ||||
|       }, | ||||
|       update_focused_file = { enable = true, update_root = true } | ||||
|     }) | ||||
|   end | ||||
| } | ||||
|  |  | |||
|  | @ -1,3 +1 @@ | |||
| return { | ||||
|   'mhinz/vim-startify' | ||||
| } | ||||
| return {'mhinz/vim-startify'} | ||||
|  |  | |||
|  | @ -1,25 +1,37 @@ | |||
| return { | ||||
|   'nvim-telescope/telescope.nvim', | ||||
|   version = '*', | ||||
|   dependencies = { 'nvim-lua/plenary.nvim' }, | ||||
|   config = function () | ||||
|   dependencies = {'nvim-lua/plenary.nvim'}, | ||||
|   config = function() | ||||
|     -- Find files using lua fuctions | ||||
| 	  local opts = { silent = true, noremap = true } | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>ff', "<Cmd>lua require'telescope.builtin'.find_files()<CR>", {silent=false, noremap=true}) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>fg', "<Cmd>lua require'telescope.builtin'.live_grep()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>fs', "<Cmd>lua require'telescope.builtin'.grep_string()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>ft', "<Cmd>lua require'telescope.builtin'.file_browser()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>fo', "<Cmd>lua require'telescope.builtin'.oldfiles()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>gc', "<Cmd>lua require'telescope.builtin'.git_commits()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>gb', "<Cmd>lua require'telescope.builtin'.git_branches()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>fb', "<Cmd>lua require'telescope.builtin'.buffers()<CR>", opts) | ||||
| 	vim.api.nvim_set_keymap('n', '<Leader>fh', "<Cmd>lua require'telescope.builtin'.help_tags()<CR>", opts) | ||||
|     local opts = {silent = true, noremap = true} | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>ff', | ||||
|                             "<Cmd>lua require'telescope.builtin'.find_files()<CR>", | ||||
|                             {silent = false, noremap = true}) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>fg', | ||||
|                             "<Cmd>lua require'telescope.builtin'.live_grep()<CR>", opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>fs', | ||||
|                             "<Cmd>lua require'telescope.builtin'.grep_string()<CR>", opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>ft', | ||||
|                             "<Cmd>lua require'telescope.builtin'.file_browser()<CR>", opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>fo', "<Cmd>lua require'telescope.builtin'.oldfiles()<CR>", | ||||
|                             opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>gc', | ||||
|                             "<Cmd>lua require'telescope.builtin'.git_commits()<CR>", opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>gb', | ||||
|                             "<Cmd>lua require'telescope.builtin'.git_branches()<CR>", opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>fb', "<Cmd>lua require'telescope.builtin'.buffers()<CR>", | ||||
|                             opts) | ||||
|     vim.api.nvim_set_keymap('n', '<Leader>fh', | ||||
|                             "<Cmd>lua require'telescope.builtin'.help_tags()<CR>", opts) | ||||
| 
 | ||||
|     local actions = require('telescope.actions') | ||||
|     require('telescope').setup { | ||||
|       defaults = { | ||||
|         -- program to use for searching with its arguments | ||||
| 			find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'}, | ||||
|         find_command = { | ||||
|           'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' | ||||
|         }, | ||||
|         -- prompt_position = 'top', -- have prompt at the top (has no effect on vertical configuration) | ||||
|         prompt_prefix = ' ', -- symbol on prompt window | ||||
|         selection_caret = ' ', -- symbol on selected row in results window | ||||
|  | @ -28,9 +40,7 @@ return { | |||
|         selection_strategy = 'reset', -- what happens to selection when list changes | ||||
|         sorting_strategy = 'ascending', -- start with most important search on top | ||||
|         layout_strategy = 'horizontal', -- vertical layout | ||||
| 			layout_config = { | ||||
| 				prompt_position = 'top' | ||||
| 			}, | ||||
|         layout_config = {prompt_position = 'top'}, | ||||
|         file_sorter = require'telescope.sorters'.get_fuzzy_file, | ||||
|         file_ignore_patterns = {'node_modules/.*'}, -- never search in node_modules/ dir | ||||
|         generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, | ||||
|  | @ -52,22 +62,17 @@ return { | |||
|             ['<C-k>'] = actions.move_selection_previous, | ||||
|             ['<C-q>'] = actions.smart_send_to_qflist + actions.open_qflist, | ||||
|             -- ['ć'] = actions.close, | ||||
| 					['<CR>'] = actions.select_default + actions.center, | ||||
|             ['<CR>'] = actions.select_default + actions.center | ||||
|           }, | ||||
|           n = { | ||||
|             ['<C-j>'] = actions.move_selection_next, | ||||
|             ['<C-k>'] = actions.move_selection_previous, | ||||
|             ['<C-q>'] = actions.smart_send_to_qflist + actions.open_qflist, | ||||
| 					['ć'] = actions.close, | ||||
|             ['ć'] = actions.close | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
| 		extensions = { | ||||
| 			fzy_native = { | ||||
| 				override_generic_sorter = false, | ||||
| 				override_file_sorter = true, | ||||
| 			} | ||||
| 		} | ||||
|       extensions = {fzy_native = {override_generic_sorter = false, override_file_sorter = true}} | ||||
|     } | ||||
|   end | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue