modeline

Vim: read modeline after opening the file?

。_饼干妹妹 提交于 2021-02-07 06:49:35
问题 I work on a variety of projects and many of them set file-specific vim settings. I have been asked to not have modelines set in .vimrc; is there a way after loading the file to load the modelines settings? So if I open tmp.c with vim: int main(int argc, char* argv[]) { return 0; } /* vim: set expandtab tabstop=4 : */ Is there a command I can run to set the stuff in the modeline? Just doing :set modeline after it is open doesn't do anything. 回答1: After :set modeline , reload your buffer with

Vim: disable autocmd BufRead (modeline)

梦想的初衷 提交于 2020-12-13 03:34:03
问题 From this answer I executed: :set modeline | doautocmd BufRead Since then, I cannot disable the BufRead . I can open a file and unset the modeline : :set nomodeline :e! :wq But when I reopen the same file, its modeline is again auto executed. I tried noautocmd - autocmd-remove: :noautocmd w BufRead :noautocmd BufRead :exe "au! BufRead *" :au! BufRead Note I want to disable all auto executed because of BufRead , not just a single event set by it like here explained: https://stackoverflow.com/a

FBIOPUT_VSCREENINFO and modelines

谁说胖子不能爱 提交于 2019-12-11 04:45:53
问题 I am trying to change the screen configuration with FBIOPUT_VSCREENINFO, but I do not have a clue how to compute: __u32 pixclock; /* pixel clock in ps (pico seconds) */ __u32 left_margin; /* time from sync to picture */ __u32 right_margin; /* time from picture to sync */ __u32 upper_margin; /* time from sync to picture */ __u32 lower_margin; __u32 hsync_len; /* length of horizontal sync */ __u32 vsync_len; (see: http://lxr.free-electrons.com/source/include/linux/fb.h#L245 ) for the fb_var

Change Emacs Mode-Line color based on major-mode

冷暖自知 提交于 2019-12-07 04:37:58
问题 I like to see if there is a way to change the mode-link foreground and background color base on the major-mode, I was thinking to add the logic in the (add-hook 'after-change-major-mode-hook But, I do not have all the emacs lisp experience to make such change. Here is the logic: switch major-mode: case "emacs-lisp-mode": (set-face-foreground 'mode-line "ivory") (set-face-background 'mode-line "DarkOrange2") case "ruby-mode": (set-face-foreground 'mode-line "white") (set-face-background 'mode

Change Emacs Mode-Line color based on major-mode

旧城冷巷雨未停 提交于 2019-12-05 06:39:35
I like to see if there is a way to change the mode-link foreground and background color base on the major-mode, I was thinking to add the logic in the (add-hook 'after-change-major-mode-hook But, I do not have all the emacs lisp experience to make such change. Here is the logic: switch major-mode: case "emacs-lisp-mode": (set-face-foreground 'mode-line "ivory") (set-face-background 'mode-line "DarkOrange2") case "ruby-mode": (set-face-foreground 'mode-line "white") (set-face-background 'mode-line "red") ... default: (set-face-foreground 'mode-line "black") (set-face-background 'mode-line