A list of puns related to "Current Buffer"
Hello vimmers π
I made this mostly for myself this morning. But decided to quickly push it out as a plugin.
Trying to K.I.S.S and not over complicate the code.
You can just as easily copy the code from plugin/autowrite.vim into your own vim configs :)
Understand there also might be many plugins doing similar, but from my quick research some of them maybe didn't work, especially with newer vim distributions such as Neovim.
For example, if I run M-x shell it opens a new buffer instead of changing the current buffer. The older version of emacs I used didn't do that.
Hey all! I am new to neovim (have use vim in the past) but I decided to get a "fresh start" and not port my vim config over.
I'm currently using CosmicNvim along with Bufferline. I have bufferline configured to run `:bdelete! %d` as the close command, but event calling `:bdelete` directly has the same result: neovim is closed completely rather than just the current buffer.
I am not sure if this is just a misunderstanding of how it should work or not so I thought I'd ask some experts. Thanks in advance!
This issue is happening to me on 2 language server Iβve tried, pyright and bash-language-server.. but not happening on yaml-language-server or sumneko_lua. How can I fix it?
When I create/open .zsh or .sh buffers, I get error on tittle of this post .
LSP shows bash-language-server attached:
Language client log: /home/ec2-user/.cache/nvim/lsp.log~ Detected filetype: zsh
~ 1 client(s) attached to this buffer:
~ Client: bashls (id: 1, pid: 19321, bufnr: [1])
~ filetypes: sh, zsh
~ autostart: true
~ root directory: Running in single file mode.
~ cmd: /usr/bin/bash-language-server start
lsp log shows:
[START][2021-12-06 00:07:13] LSP logging initiated
2 [WARN][2021-12-06 00:08:44] .../lua/vim/lsp.lua:89> "method textDocument/codeAction is not supported by any of the servers registered for the current buffer"
As an attempt tp troubleshoot, I added this code on my configuration:
4 if client.resolved_capabilities.code_action then
3 print("codeAction present")
2 else
1 print("No codeAction")
ο ΄ 52 end ο ΄
.. and nvim prints βNo codeActionβ.
What can I do?
Some details of my setup:
Versions
NVIM v0.7.0-dev+672-g1e6eeca9d
is that even possible with the LSP protocol?
The title is probably confusing as I am not entirely sure how to ask this. I use the bufferline plugin to get a more modern looking tabline, but am having two annyounces.
The first is that bufferline will show spits in the tab list. So if I am in one file and open a split of another the split will then be shown in the tabline. This often confuses me and I would rather only show tabs. Does bufferline support this?
The second question is actually about how buffers work themselves. I have noticed that if I open neovim, open a file, then q
and move to another file I will see that last opened file in bufferline. I believe this is due to some server neovim runs, but this often makes is hard for me to manage projects in neovim. How can I disable this behavior?
I'm trying to get this concept of a buffer straight. It is my understanding that power supply amperage ratings are basically the amount of current they can supply at a given voltage. If you are driving a load at a certain voltage, the load can take up to the rated amp. For buffers, they take a signal of a certain voltage and can up the amps at the same voltage. If I have a load in the circuit, could the buffer produce too much amp and kill the load, so to speak? Or does the load only take what it needs?
....Thank me later! π
Note: Keeping in mind it being especially a competitor's business. (Restaurant, etc).
Hi there! Sorry if this is obvious - I'm reading through the man pages and I can't seem to figure out how to do this.
I'm having issues with stale diagnostics in a large repo. To reset diagnostics, I use :LspRestart<CR>:e<CR>
, as suggested in the docs. This works, but it doesn't clear the cache. In my particular use case, I use Lspsaga keybindings which hook into vim.lsp.diagnostic.get_next()
. After resetting the LSP server, the get_next()
keybindings still have access to the stale diagnostics.
I found the vim.lsp.diagnostic.reset()
, which looks like exactly what I need, but I'm not sure how to get the correct parameters. Ideally I can just add this to the same keybinding which restarts LSP for me. Any thoughts?
thank you!
An amp per amp amp.
When editing a file, is there a way to insert the name of the file into the buffer?
Is it also possible to do the same for:
Played way back in mod 10 with friends, but I kinda want to play a buffer/debuffer class instead of a basic "only do DPS" class. My girlfriend is going to be playing a devoted cleric, and I've seen mention of warlock being a little okay since the buff/debuff nerfs in mod 17(?). Is this still true? What's the best buffing/debuffing class?
I was searching for a function that would update the timestamp of the updated_at
key in the YAML frontmatter of my blog posts and wiki entries and stuff.
I didn't find any convenience helper that would let me operate on YAML frontmatter data, so I hacked together a function that
updated_at
key inside the frontmatter; if none is found, just dump the attribute at the end of the YAML frontmatter block.The result wasn't super hard to figure out (ok it took way longer than I would've liked but less long than I had feared), but I find the nested ifs and the search-forward and looking-at calld to be a bit all over the place.
How would you approach writing a pattern finder like that with Emacs Lisp? Suggestions are very welcome!
And you can all use this function, of course.
(defun ct/yaml/update-post ()
"Insert or update an updated_at attribute in the buffer's YAML frontmatter, or insert a frontmatter block if none exists."
(interactive)
(defun _timestamp ()
(format-time-string "%Y-%m-%d %H:%M:%S +0100"))
(save-excursion
(goto-char (point-min))
;; Find the YAML frontmatter block boundaries, ignoring (optional) beginning of the block.
(when (looking-at-p "^---") (forward-line +1))
(let ((target-pos (point))
(yaml-end-pos (search-forward-regexp "^---" nil t)))
(if (not yaml-end-pos)
;; No YAML block, yet; insert a new one
(progn
(goto-char target-pos)
(insert "updated_at: " (_timestamp)) (newline)
(insert "---") (newline))
;; If YAML block is found, update or insert the date entry
(progn
(goto-char target-pos)
(if (search-forward-regexp "^updated_at:" yaml-end-pos t)
(progn
(kill-line) ;; point is after the ':' value separator b/c of search-forward
(insert " " (_timestamp)))
(progn
(goto-char yaml-end-pos)
(beginning-of-line)
(insert "updated_at: " (_timestamp))
(newline))))))))
I've been using this function, but I wonder if there's a more straightforward method that I'm overlooking (especially since I'd like to avoid the table to string conversion):
local buffer_to_string = function()
local content = vim.api.nvim_buf_get_lines(0, 0, vim.api.nvim_buf_line_count(0), false)
return table.concat(content, "\n")
end
What I'm trying to do is, say I have 2-4 splits with each file being a different filetype like a .c or .py file, when I switch between each buffer split can I configure it so that when I switch to a certain buffer to edit, it will detect what type of file it is and do whatever I had it set up like enabling/disabling a mapping? I've tried before with autocmd
and FileType
and a couple of Buffer
events but haven't been successful.
I am trying to map a function key to save the current buffer to disk but I can not find the lua api to do it. I imagined it would look like this in init.vim:
map <F24> <cmd>lua vim.api.save_buffer(0)<CR>
I went through the api documentation and it does not say anything about saving.Can anybody help?
Edit: Found it, this seems to work:
nnoremap <F13> <cmd> lua vim.api.nvim_command('write')<CR>
Hi there folks,
When using vanilla Emacs I had a function binded to a combination of keys to automatically scrolling up the current buffer so that the first line became the one where I had the point. This was great to access a whole view of eg a function whose first line was where the point was currently located. The best I do now is just centering the view with C-l
Is there anyway (or even a function to provide in my config.el) to provide the same functionality?
Currently I have this which works but the cursor gets moved in the current buffer
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit',
\ 'ctrl-o': ':r !echo',
\ }
When pressing ctrl-o in the window it works for example for :Files but when I do :Rg the filename is read into the buffer as well but the cursor in the buffer is moved to the top of the file.
Someone has a solution for stopping the cursor from moving in the buffer?
Hi,
I am trying to do a function that:
a) Refresh all tables in my buffer (Easy with org-table-recalculate-buffer-tables)
b) Regenerate all GNUPLOT graphs associated with each table
c) Refresh corresponding inline images in the buffer (easy with org-redisplay-inline-images)
However, I am not able to see how to do b): for each table in the buffer I would like to generate again the GNUPlot PNG. How can I do that?
My current function:
;; Refresh tables and graphs
(defun my/refresh-tables-and-graphs()
(interactive)
(org-table-recalculate-buffer-tables)
(org-display-inline-images)
(org-redisplay-inline-images))
(global-set-key (kbd "<f8>") 'my/refresh-tables-and-graphs)
Many thanks!
id like to know if its possible that floaterm doesnt open always in the home directory but rather in the current working directory of the buffer im currently working on.
im asking this specifically because of git. id like to be able to commit changes on the fly without much hassle (switching to needed dir first).
ive fugitive installed but whe im in a buffer and enter :git add filename of current file
i get an error message. so thats not a possibility right now (or ive set it up wrong). if possible id like to avoid other programs like lazygit or other git helpers.
so if possible id either be able to simply add a command directly from via in the terminal or open floaterm in cwd.
maybe someone here has an idea.
oh- i forgot. right now i simply open and close it via let g:floaterm_keymap_toggle = '<F1>'
Hi everyone, Iβm trying so hard to get a list if buffers in current tab, is there a way todo thst. Thanks
Hi there, am looking for a way to show current buffer tabs only in current tab. I tend to used tabs as workspace.
Thanks
I'm in Power Systems and haven't thought about small signal devices in quite some time. I purchased a very good revenue grade power meter to monitor and control my own power consumption. I already have revenue grade (0.5%) current transformers installed in my breaker box and would like to use these.
My meter (Ebay) has inputs for current sensors, not current transformers (see attached spec). My first thought was to place a 2 Ohm, 50W resistor across the CT secondary. The V=I*R part worked, but the meter didn't register properly nor was change linear. BTW I test power meters and complex protection devices as a part of my job and have a 3 phase power system simulator at my desk. Our devices are generally 0-120V & 0-100A into the meter. What I'm saying is that offsets ratio correction factors, I'm used to dealing with.
When I contacted the meter manufacturer, they advised my that the meter 1 Meg input impedance would cause trouble with the CT-resistor I had first envisioned. The manufacturer refers to the current sensors as "Low Energy Analog" devices.
I've found that even if I inject a small AC voltage (1-10) from test set, I do not get reasonable values.
Is there and op amp circuit or buffer I can cobble together to enable my existing, installed CT's to drive the input?
Device is a SEL-734B, which was designed for MV capacitor control, but its really a SEL-734 revenue meter with a slightly different analog input board.
Thanks!
https://preview.redd.it/cv6ffaelyye61.jpg?width=540&format=pjpg&auto=webp&s=cd375ffc124d00eb5e4702d5719b8bcedc72d6ae
Michael was good for a while but heβs past it these days, would probs only be a 3 division world champ. Lennon on the other hand is still in his prime and is probs a 6/7 division world champ.
so far I have this
function! Dir_subsitute(arg1, arg2)
argadd **/*.<c-r>=expand('%:e')
argdo %s/arg1/arg2/gec
endfunction
command -nargs=\* Sub execute 'call Dir_subsitute(<f-args>)'
:Sub function fun
But its not working I can't get the arguments working
It things I have sent
:Sub arg1 arg2
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.